/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    cn-hangzhou-finance = 'sofa.cn-shanghai.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('sofa', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddMsConfigAttributesRequest {
  attributeName?: string(name='AttributeName', example='age'),
  desc?: string(name='Desc'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  resourceId?: long(name='ResourceId', example='100'),
}

model AddMsConfigAttributesResponseBody = {
  attribute?: {
    attributeName?: string(name='AttributeName', example='switch'),
    desc?: string(name='Desc'),
    id?: long(name='Id', example='1'),
    instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  }(name='Attribute'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model AddMsConfigAttributesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddMsConfigAttributesResponseBody(name='body'),
}

async function addMsConfigAttributesWithOptions(request: AddMsConfigAttributesRequest, runtime: Util.RuntimeOptions): AddMsConfigAttributesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.attributeName)) {
    body['AttributeName'] = request.attributeName;
  }
  if (!Util.isUnset(request.desc)) {
    body['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddMsConfigAttributes',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addMsConfigAttributes(request: AddMsConfigAttributesRequest): AddMsConfigAttributesResponse {
  var runtime = new Util.RuntimeOptions{};
  return addMsConfigAttributesWithOptions(request, runtime);
}

model AddMsConfigResourcesRequest {
  appName?: string(name='AppName', example='foo'),
  attributes?: string(name='Attributes', example='[  {  "attribute_name":"attName",  "desc":"some attribute comment" },  ...  ]'),
  desc?: string(name='Desc'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  region?: string(name='Region', example='Alipay'),
  resourceId?: string(name='ResourceId', example='com.alipay.test.resource'),
}

model AddMsConfigResourcesResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resource?: {
    appName?: string(name='AppName', example='drmdemo'),
    attributes?: [ 
      {
        attributeName?: string(name='AttributeName', example='switch'),
        desc?: string(name='Desc'),
        id?: long(name='Id', example='1'),
        instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
      }
    ](name='Attributes'),
    desc?: string(name='Desc'),
    id?: long(name='Id', example='1'),
    instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
    region?: string(name='Region', example='Alipay'),
    resourceId?: string(name='ResourceId', example='com.alipay.drmResource'),
  }(name='Resource'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model AddMsConfigResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddMsConfigResourcesResponseBody(name='body'),
}

async function addMsConfigResourcesWithOptions(request: AddMsConfigResourcesRequest, runtime: Util.RuntimeOptions): AddMsConfigResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.attributes)) {
    body['Attributes'] = request.attributes;
  }
  if (!Util.isUnset(request.desc)) {
    body['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.region)) {
    body['Region'] = request.region;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddMsConfigResources',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addMsConfigResources(request: AddMsConfigResourcesRequest): AddMsConfigResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return addMsConfigResourcesWithOptions(request, runtime);
}

model CreateMqSofamqGroupRequest {
  groupId?: string(name='GroupId', example='test_group_id'),
  groupType?: string(name='GroupType', example='tcp'),
  instanceId?: string(name='InstanceId', example='SOFAMQ_INSTANCE_000001'),
  remark?: string(name='Remark', example='test'),
}

model CreateMqSofamqGroupResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model CreateMqSofamqGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateMqSofamqGroupResponseBody(name='body'),
}

async function createMqSofamqGroupWithOptions(request: CreateMqSofamqGroupRequest, runtime: Util.RuntimeOptions): CreateMqSofamqGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupType)) {
    body['GroupType'] = request.groupType;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.remark)) {
    body['Remark'] = request.remark;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateMqSofamqGroup',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createMqSofamqGroup(request: CreateMqSofamqGroupRequest): CreateMqSofamqGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMqSofamqGroupWithOptions(request, runtime);
}

model CreateMqSofamqTopicRequest {
  instanceId?: string(name='InstanceId', example='000001'),
  messageType?: long(name='MessageType', example='0'),
  remark?: string(name='Remark'),
  topic?: string(name='Topic', example='test'),
}

model CreateMqSofamqTopicResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model CreateMqSofamqTopicResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateMqSofamqTopicResponseBody(name='body'),
}

async function createMqSofamqTopicWithOptions(request: CreateMqSofamqTopicRequest, runtime: Util.RuntimeOptions): CreateMqSofamqTopicResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.messageType)) {
    body['MessageType'] = request.messageType;
  }
  if (!Util.isUnset(request.remark)) {
    body['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateMqSofamqTopic',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createMqSofamqTopic(request: CreateMqSofamqTopicRequest): CreateMqSofamqTopicResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMqSofamqTopicWithOptions(request, runtime);
}

model CreateRMSUnifiedAlarmRuleRequest {
  alarmNodata?: long(name='AlarmNodata'),
  category?: string(name='Category', example='CUSTOM'),
  channelsRepeatList?: [ string ](name='ChannelsRepeatList'),
  emergency?: string(name='Emergency'),
  emergencyUrl?: string(name='EmergencyUrl'),
  level?: long(name='Level', example='1'),
  name?: string(name='Name', example='uitest1645783390369'),
  notifyFiring?: long(name='NotifyFiring'),
  notifyNodata?: long(name='NotifyNodata'),
  notifyRecovered?: long(name='NotifyRecovered'),
  notifyTarget?: [ 
    {
      subscriber?: string(name='Subscriber', example='1'),
      subscriberName?: string(name='SubscriberName'),
      subscriberSource?: string(name='SubscriberSource', example='LOCAL'),
      subscriberType?: string(name='SubscriberType', example='USER_GROUP'),
      subscriberUuid?: string(name='SubscriberUuid', example='400'),
    }
  ](name='NotifyTarget'),
  notifyTimeFilterJsonStr?: string(name='NotifyTimeFilterJsonStr'),
  pendingHit?: long(name='PendingHit'),
  recoveredHit?: long(name='RecoveredHit'),
  ruleConfig?: string(name='RuleConfig', example='{\\"trafficType\\":\\"i\\",\\"methodName\\":\\"*\\",\\"faultInjectRuleItems\\":[{\\"action\\":{\\"type\\":\\"REJECT\\"},\\"ruleType\\":\\"ABORT\\",\\"configs\\":{\\"faultPercent\\":100}}]}'),
  silenceTime?: long(name='SilenceTime', example='300'),
  step?: long(name='Step', example='1'),
  workspaceName?: string(name='WorkspaceName', example='prod'),
}

model CreateRMSUnifiedAlarmRuleResponseBody = {
  requestId?: string(name='RequestId', example='5F656C56-F99E-5C1E-AE7F-D9F78AC8D706'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model CreateRMSUnifiedAlarmRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateRMSUnifiedAlarmRuleResponseBody(name='body'),
}

async function createRMSUnifiedAlarmRuleWithOptions(request: CreateRMSUnifiedAlarmRuleRequest, runtime: Util.RuntimeOptions): CreateRMSUnifiedAlarmRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.alarmNodata)) {
    body['AlarmNodata'] = request.alarmNodata;
  }
  if (!Util.isUnset(request.category)) {
    body['Category'] = request.category;
  }
  if (!Util.isUnset(request.channelsRepeatList)) {
    body['ChannelsRepeatList'] = request.channelsRepeatList;
  }
  if (!Util.isUnset(request.emergency)) {
    body['Emergency'] = request.emergency;
  }
  if (!Util.isUnset(request.emergencyUrl)) {
    body['EmergencyUrl'] = request.emergencyUrl;
  }
  if (!Util.isUnset(request.level)) {
    body['Level'] = request.level;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.notifyFiring)) {
    body['NotifyFiring'] = request.notifyFiring;
  }
  if (!Util.isUnset(request.notifyNodata)) {
    body['NotifyNodata'] = request.notifyNodata;
  }
  if (!Util.isUnset(request.notifyRecovered)) {
    body['NotifyRecovered'] = request.notifyRecovered;
  }
  if (!Util.isUnset(request.notifyTarget)) {
    body['NotifyTarget'] = request.notifyTarget;
  }
  if (!Util.isUnset(request.notifyTimeFilterJsonStr)) {
    body['NotifyTimeFilterJsonStr'] = request.notifyTimeFilterJsonStr;
  }
  if (!Util.isUnset(request.pendingHit)) {
    body['PendingHit'] = request.pendingHit;
  }
  if (!Util.isUnset(request.recoveredHit)) {
    body['RecoveredHit'] = request.recoveredHit;
  }
  if (!Util.isUnset(request.ruleConfig)) {
    body['RuleConfig'] = request.ruleConfig;
  }
  if (!Util.isUnset(request.silenceTime)) {
    body['SilenceTime'] = request.silenceTime;
  }
  if (!Util.isUnset(request.step)) {
    body['Step'] = request.step;
  }
  if (!Util.isUnset(request.workspaceName)) {
    body['WorkspaceName'] = request.workspaceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateRMSUnifiedAlarmRule',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createRMSUnifiedAlarmRule(request: CreateRMSUnifiedAlarmRuleRequest): CreateRMSUnifiedAlarmRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRMSUnifiedAlarmRuleWithOptions(request, runtime);
}

model DeleteMqSofamqGroupRequest {
  groupId?: string(name='GroupId', example='test_group_id'),
  instanceId?: string(name='InstanceId', example='SOFAMQ_INSTANCE_000001'),
}

model DeleteMqSofamqGroupResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model DeleteMqSofamqGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteMqSofamqGroupResponseBody(name='body'),
}

async function deleteMqSofamqGroupWithOptions(request: DeleteMqSofamqGroupRequest, runtime: Util.RuntimeOptions): DeleteMqSofamqGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMqSofamqGroup',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteMqSofamqGroup(request: DeleteMqSofamqGroupRequest): DeleteMqSofamqGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMqSofamqGroupWithOptions(request, runtime);
}

model DeleteMqSofamqTopicRequest {
  instanceId?: string(name='InstanceId', example='000001'),
  topic?: string(name='Topic', example='test'),
}

model DeleteMqSofamqTopicResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model DeleteMqSofamqTopicResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteMqSofamqTopicResponseBody(name='body'),
}

async function deleteMqSofamqTopicWithOptions(request: DeleteMqSofamqTopicRequest, runtime: Util.RuntimeOptions): DeleteMqSofamqTopicResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMqSofamqTopic',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteMqSofamqTopic(request: DeleteMqSofamqTopicRequest): DeleteMqSofamqTopicResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMqSofamqTopicWithOptions(request, runtime);
}

model DeleteMqSofamqTraceRequest {
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  queryId?: string(name='QueryId', example='272967562652883649157096685****'),
}

model DeleteMqSofamqTraceResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model DeleteMqSofamqTraceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteMqSofamqTraceResponseBody(name='body'),
}

async function deleteMqSofamqTraceWithOptions(request: DeleteMqSofamqTraceRequest, runtime: Util.RuntimeOptions): DeleteMqSofamqTraceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.queryId)) {
    body['QueryId'] = request.queryId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMqSofamqTrace',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteMqSofamqTrace(request: DeleteMqSofamqTraceRequest): DeleteMqSofamqTraceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMqSofamqTraceWithOptions(request, runtime);
}

model DeleteMqSofamqWarnRequest {
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  warnId?: long(name='WarnId', example='10000001'),
}

model DeleteMqSofamqWarnResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model DeleteMqSofamqWarnResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteMqSofamqWarnResponseBody(name='body'),
}

async function deleteMqSofamqWarnWithOptions(request: DeleteMqSofamqWarnRequest, runtime: Util.RuntimeOptions): DeleteMqSofamqWarnResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.warnId)) {
    body['WarnId'] = request.warnId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMqSofamqWarn',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteMqSofamqWarn(request: DeleteMqSofamqWarnRequest): DeleteMqSofamqWarnResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMqSofamqWarnWithOptions(request, runtime);
}

model DeleteMsConfigAttributesRequest {
  id?: long(name='Id', example='1'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
}

model DeleteMsConfigAttributesResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model DeleteMsConfigAttributesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteMsConfigAttributesResponseBody(name='body'),
}

async function deleteMsConfigAttributesWithOptions(request: DeleteMsConfigAttributesRequest, runtime: Util.RuntimeOptions): DeleteMsConfigAttributesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMsConfigAttributes',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteMsConfigAttributes(request: DeleteMsConfigAttributesRequest): DeleteMsConfigAttributesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMsConfigAttributesWithOptions(request, runtime);
}

model DeleteMsConfigResourcesRequest {
  id?: long(name='Id', example='1'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
}

model DeleteMsConfigResourcesResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model DeleteMsConfigResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteMsConfigResourcesResponseBody(name='body'),
}

async function deleteMsConfigResourcesWithOptions(request: DeleteMsConfigResourcesRequest, runtime: Util.RuntimeOptions): DeleteMsConfigResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMsConfigResources',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteMsConfigResources(request: DeleteMsConfigResourcesRequest): DeleteMsConfigResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMsConfigResourcesWithOptions(request, runtime);
}

model DeleteRMSUnifiedAlarmRuleRequest {
  id?: long(name='Id', example='1'),
  workspaceName?: string(name='WorkspaceName', example='prod'),
}

model DeleteRMSUnifiedAlarmRuleResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model DeleteRMSUnifiedAlarmRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteRMSUnifiedAlarmRuleResponseBody(name='body'),
}

async function deleteRMSUnifiedAlarmRuleWithOptions(request: DeleteRMSUnifiedAlarmRuleRequest, runtime: Util.RuntimeOptions): DeleteRMSUnifiedAlarmRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.workspaceName)) {
    body['WorkspaceName'] = request.workspaceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRMSUnifiedAlarmRule',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteRMSUnifiedAlarmRule(request: DeleteRMSUnifiedAlarmRuleRequest): DeleteRMSUnifiedAlarmRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRMSUnifiedAlarmRuleWithOptions(request, runtime);
}

model DescribeCasComputersRequest {
  appServiceIdsRepeatList?: [ string ](name='AppServiceIdsRepeatList'),
  currentPage?: long(name='CurrentPage', example='21'),
  name?: string(name='Name', example='opscenter'),
  pageSize?: long(name='PageSize', example='100'),
  workspace?: string(name='Workspace', example='shfinpre'),
}

model DescribeCasComputersResponseBody = {
  currentPage?: long(name='CurrentPage', example='16'),
  data?: [ 
    {
      appId?: string(name='AppId'),
      appServiceIds?: [ string ](name='AppServiceIds'),
      assignedAppServiceIds?: [ string ](name='AssignedAppServiceIds'),
      autoRenew?: boolean(name='AutoRenew'),
      autoRenewPeriod?: long(name='AutoRenewPeriod'),
      bandwidth?: long(name='Bandwidth'),
      commonImage?: boolean(name='CommonImage'),
      cpu?: long(name='Cpu'),
      cpuShared?: boolean(name='CpuShared'),
      creationTime?: string(name='CreationTime'),
      dataDisks?: [ 
        {
          category?: string(name='Category'),
          computer?: {
            iaasId?: string(name='IaasId'),
            id?: string(name='Id'),
            name?: string(name='Name'),
            status?: string(name='Status'),
          }(name='Computer'),
          deleteAutoSnapshot?: boolean(name='DeleteAutoSnapshot'),
          deleteWithComputer?: boolean(name='DeleteWithComputer'),
          device?: string(name='Device'),
          enableAutoSnapshot?: boolean(name='EnableAutoSnapshot'),
          iaasId?: string(name='IaasId'),
          id?: string(name='Id'),
          imageId?: string(name='ImageId'),
          name?: string(name='Name'),
          portable?: boolean(name='Portable'),
          providerId?: string(name='ProviderId'),
          regionId?: string(name='RegionId'),
          size?: long(name='Size'),
          status?: string(name='Status'),
          tenantId?: string(name='TenantId'),
          type?: string(name='Type'),
          utcCreate?: string(name='UtcCreate'),
          utcModified?: string(name='UtcModified'),
          workspaceId?: string(name='WorkspaceId'),
          zoneId?: string(name='ZoneId'),
        }
      ](name='DataDisks'),
      deployMode?: string(name='DeployMode'),
      description?: string(name='Description'),
      elasticIp?: string(name='ElasticIp'),
      expiredTime?: string(name='ExpiredTime'),
      iaasId?: string(name='IaasId'),
      iaasStatus?: string(name='IaasStatus'),
      iaasType?: string(name='IaasType'),
      id?: string(name='Id'),
      imageIaasId?: string(name='ImageIaasId'),
      imageId?: string(name='ImageId'),
      imageName?: string(name='ImageName'),
      initialized?: boolean(name='Initialized', example='true'),
      instanceChargeType?: string(name='InstanceChargeType'),
      ioOptimized?: boolean(name='IoOptimized'),
      lastOpsOrderId?: string(name='LastOpsOrderId'),
      lastOpsType?: string(name='LastOpsType'),
      memory?: long(name='Memory'),
      name?: string(name='Name'),
      networkType?: string(name='NetworkType'),
      options?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Options'),
      os?: string(name='Os'),
      osBit?: long(name='OsBit'),
      osVersion?: string(name='OsVersion'),
      paasStatus?: string(name='PaasStatus'),
      password?: string(name='Password'),
      privateIp?: string(name='PrivateIp'),
      providerId?: string(name='ProviderId'),
      publicIp?: string(name='PublicIp'),
      regionId?: string(name='RegionId'),
      serialNumber?: string(name='SerialNumber'),
      specIaasId?: string(name='SpecIaasId'),
      status?: string(name='Status'),
      systemDisk?: {
        category?: string(name='Category'),
        computer?: {
          iaasId?: string(name='IaasId'),
          id?: string(name='Id'),
          name?: string(name='Name'),
          status?: string(name='Status'),
        }(name='Computer'),
        deleteAutoSnapshot?: boolean(name='DeleteAutoSnapshot'),
        deleteWithComputer?: boolean(name='DeleteWithComputer'),
        device?: string(name='Device'),
        enableAutoSnapshot?: boolean(name='EnableAutoSnapshot'),
        iaasId?: string(name='IaasId'),
        id?: string(name='Id'),
        imageId?: string(name='ImageId'),
        name?: string(name='Name'),
        portable?: boolean(name='Portable'),
        providerId?: string(name='ProviderId'),
        regionId?: string(name='RegionId'),
        size?: long(name='Size'),
        status?: string(name='Status'),
        tenantId?: string(name='TenantId'),
        type?: string(name='Type'),
        utcCreate?: string(name='UtcCreate'),
        utcModified?: string(name='UtcModified'),
        workspaceId?: string(name='WorkspaceId'),
        zoneId?: string(name='ZoneId'),
      }(name='SystemDisk'),
      tags?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tags'),
      tenantId?: string(name='TenantId'),
      tenantId2?: string(name='TenantId2'),
      threadsPerCore?: long(name='ThreadsPerCore'),
      utcCreate?: string(name='UtcCreate'),
      utcModified?: string(name='UtcModified'),
      vSwitchIaasId?: string(name='VSwitchIaasId'),
      vpcId?: string(name='VpcId'),
      workspaceId?: string(name='WorkspaceId'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='Data'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId', example='DB5EB9EB-8690-570B-8A7F-41FF1C89C02E'),
  resultCode?: string(name='ResultCode'),
  resultMessage?: string(name='ResultMessage'),
  totalCount?: long(name='TotalCount', example='75'),
}

model DescribeCasComputersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeCasComputersResponseBody(name='body'),
}

async function describeCasComputersWithOptions(request: DescribeCasComputersRequest, runtime: Util.RuntimeOptions): DescribeCasComputersResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appServiceIdsRepeatList)) {
    body['AppServiceIdsRepeatList'] = request.appServiceIdsRepeatList;
  }
  if (!Util.isUnset(request.currentPage)) {
    body['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.workspace)) {
    body['Workspace'] = request.workspace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCasComputers',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeCasComputers(request: DescribeCasComputersRequest): DescribeCasComputersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCasComputersWithOptions(request, runtime);
}

model DisableMqSofamqWarnRequest {
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  warnId?: long(name='WarnId', example='10000001'),
}

model DisableMqSofamqWarnResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model DisableMqSofamqWarnResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableMqSofamqWarnResponseBody(name='body'),
}

async function disableMqSofamqWarnWithOptions(request: DisableMqSofamqWarnRequest, runtime: Util.RuntimeOptions): DisableMqSofamqWarnResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.warnId)) {
    body['WarnId'] = request.warnId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DisableMqSofamqWarn',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableMqSofamqWarn(request: DisableMqSofamqWarnRequest): DisableMqSofamqWarnResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableMqSofamqWarnWithOptions(request, runtime);
}

model EnableMqSofamqWarnRequest {
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  warnId?: long(name='WarnId', example='10001'),
}

model EnableMqSofamqWarnResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model EnableMqSofamqWarnResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableMqSofamqWarnResponseBody(name='body'),
}

async function enableMqSofamqWarnWithOptions(request: EnableMqSofamqWarnRequest, runtime: Util.RuntimeOptions): EnableMqSofamqWarnResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.warnId)) {
    body['WarnId'] = request.warnId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EnableMqSofamqWarn',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableMqSofamqWarn(request: EnableMqSofamqWarnRequest): EnableMqSofamqWarnResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableMqSofamqWarnWithOptions(request, runtime);
}

model GetMqSofamqConsumerJStackRequest {
  cell?: string(name='Cell', example='RZ00A'),
  clientId?: string(name='ClientId', example='10.15.232.86@1129e#e4a224f4#2fa8320f33c4#eyIwIjoienRoIn0='),
  groupId?: string(name='GroupId', example='GID_test_group_id'),
  instanceId?: string(name='InstanceId', example='INSTANCE_ID_111'),
}

model GetMqSofamqConsumerJStackResponseBody = {
  data?: {
    clientId?: string(name='ClientId', example='10.15.232.86@1129e#e4a224f4#2fa8320f33c4#eyIwIjoienRoIn0='),
    jstack?: [ 
      {
        thread?: string(name='Thread', example='ConsumeMessageThread_0'),
        trackList?: [ string ](name='TrackList'),
      }
    ](name='Jstack'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model GetMqSofamqConsumerJStackResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMqSofamqConsumerJStackResponseBody(name='body'),
}

async function getMqSofamqConsumerJStackWithOptions(request: GetMqSofamqConsumerJStackRequest, runtime: Util.RuntimeOptions): GetMqSofamqConsumerJStackResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.clientId)) {
    body['ClientId'] = request.clientId;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetMqSofamqConsumerJStack',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMqSofamqConsumerJStack(request: GetMqSofamqConsumerJStackRequest): GetMqSofamqConsumerJStackResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMqSofamqConsumerJStackWithOptions(request, runtime);
}

model GetMqSofamqConsumerStatusRequest {
  cell?: string(name='Cell', example='RZ01A'),
  detail?: boolean(name='Detail', example='true'),
  groupId?: string(name='GroupId', example='GID_test_group_id'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  needJstack?: boolean(name='NeedJstack', example='false'),
}

model GetMqSofamqConsumerStatusResponseBody = {
  data?: {
    connectionSet?: [ 
      {
        clientAddr?: string(name='ClientAddr', example='30.5.121.**'),
        clientId?: string(name='ClientId', example='30.5.121.**@25560#-1999745829#-1737591554#458773089270275'),
        language?: string(name='Language', example='JAVA'),
        remoteIp?: string(name='RemoteIp', example='42.120.74.**'),
        version?: string(name='Version', example='V4_3_6_SNAPSHOT'),
      }
    ](name='ConnectionSet'),
    consumeModel?: string(name='ConsumeModel', example='CLUSTERING'),
    consumeTps?: string(name='ConsumeTps', example='0'),
    consumerConnectionInfoList?: [ 
      {
        clientId?: string(name='ClientId', example='30.5.**.**@25560#-1999745829#-1737591554#458773089270275'),
        connection?: string(name='Connection', example='**'),
        consumeType?: string(name='ConsumeType', description='PUSH/PULL', example='PUSH'),
        jstack?: [ 
          {
            thread?: string(name='Thread', example='ConsumeMessageThread_0'),
            trackList?: [ string ](name='TrackList'),
          }
        ](name='Jstack'),
        language?: string(name='Language', example='JAVA'),
        lastTimestamp?: long(name='LastTimestamp', example='1570701368114'),
        messageModel?: string(name='MessageModel', example='CLUSTERING'),
        runningDataList?: [ 
          {
            diff?: long(name='Diff', example='100'),
            failedCountPerHour?: long(name='FailedCountPerHour', example='0'),
            failedTps?: string(name='FailedTps', example='0.1'),
            groupId?: string(name='GroupId', example='000'),
            okTps?: string(name='OkTps', example='0.1'),
            rt?: string(name='Rt', example='0.1'),
            topic?: string(name='Topic', example='test-mq_topic'),
          }
        ](name='RunningDataList'),
        startTimestamp?: long(name='StartTimestamp', example='1570701361528'),
        subscriptionSet?: [ 
          {
            subString?: string(name='SubString', example='*'),
            subVersion?: long(name='SubVersion', example='1570701364301'),
            tagsSet?: [ string ](name='TagsSet'),
            topic?: string(name='Topic', example='test-mq_topic'),
          }
        ](name='SubscriptionSet'),
        threadCount?: long(name='ThreadCount', example='20'),
        version?: string(name='Version', example='V4_3_6'),
      }
    ](name='ConsumerConnectionInfoList'),
    delayTime?: long(name='DelayTime', example='100857'),
    detailInTopicList?: [ 
      {
        delayTime?: long(name='DelayTime', example='0'),
        lastTimestamp?: long(name='LastTimestamp', example='1570701259403'),
        topic?: string(name='Topic', example='test-mq_topic'),
        totalDiff?: long(name='TotalDiff', example='0'),
      }
    ](name='DetailInTopicList'),
    instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
    lastTimestamp?: long(name='LastTimestamp', example='1566883844954'),
    online?: boolean(name='Online', example='true'),
    rebalanceOk?: boolean(name='RebalanceOk', example='true'),
    subscriptionSame?: boolean(name='SubscriptionSame', example='true'),
    totalDiff?: long(name='TotalDiff', example='197'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model GetMqSofamqConsumerStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMqSofamqConsumerStatusResponseBody(name='body'),
}

async function getMqSofamqConsumerStatusWithOptions(request: GetMqSofamqConsumerStatusRequest, runtime: Util.RuntimeOptions): GetMqSofamqConsumerStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.detail)) {
    body['Detail'] = request.detail;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.needJstack)) {
    body['NeedJstack'] = request.needJstack;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetMqSofamqConsumerStatus',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMqSofamqConsumerStatus(request: GetMqSofamqConsumerStatusRequest): GetMqSofamqConsumerStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMqSofamqConsumerStatusWithOptions(request, runtime);
}

model GetMqSofamqDLQMessageByIdRequest {
  cell?: string(name='Cell', example='RZ01A'),
  groupId?: string(name='GroupId', example='GID_test_group_id'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  msgId?: string(name='MsgId', example='0BC16699165C03B925DB8A404E2D****'),
}

model GetMqSofamqDLQMessageByIdResponseBody = {
  data?: {
    body?: string(name='Body', example='SGVsbG8gTVEg5raT7oWf5p6D5ai05ayt55iv'),
    bodyCrc?: long(name='BodyCrc', example='914112295'),
    bornHost?: string(name='BornHost', example='42.120.**.**:64646'),
    bornTimestamp?: long(name='BornTimestamp', example='1570761026630'),
    instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
    msgId?: string(name='MsgId', example='1E0578FE110F18B4AAC235C0C8460BA2'),
    propertyList?: [ 
      {
        name?: string(name='Name', example='TAGS'),
        value?: string(name='Value', example='TagA'),
      }
    ](name='PropertyList'),
    reconsumeTimes?: long(name='ReconsumeTimes', example='1'),
    storeHost?: string(name='StoreHost', example='11.220.***.***:10911'),
    storeSize?: long(name='StoreSize', example='407'),
    storeTimestamp?: long(name='StoreTimestamp', example='1570761026708'),
    topic?: string(name='Topic', example='test-mq_topic'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model GetMqSofamqDLQMessageByIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMqSofamqDLQMessageByIdResponseBody(name='body'),
}

async function getMqSofamqDLQMessageByIdWithOptions(request: GetMqSofamqDLQMessageByIdRequest, runtime: Util.RuntimeOptions): GetMqSofamqDLQMessageByIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.msgId)) {
    body['MsgId'] = request.msgId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetMqSofamqDLQMessageById',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMqSofamqDLQMessageById(request: GetMqSofamqDLQMessageByIdRequest): GetMqSofamqDLQMessageByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMqSofamqDLQMessageByIdWithOptions(request, runtime);
}

model GetMqSofamqMessageByIdRequest {
  cell?: string(name='Cell', example='RZ01A'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  msgId?: string(name='MsgId', example='1E0578FE110F18B4AAC235C05F2*****'),
  topic?: string(name='Topic', example='test-mq_topic'),
}

model GetMqSofamqMessageByIdResponseBody = {
  data?: {
    body?: string(name='Body', example='SGVsbG8gTVEg5raT7oWf5p6D5ai05ayt55iv'),
    bodyCrc?: long(name='BodyCrc', example='914112295'),
    bornHost?: string(name='BornHost', example='42.120.**.**:64646'),
    bornTimestamp?: long(name='BornTimestamp', example='1570761026630'),
    instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
    msgId?: string(name='MsgId', example='1E0578FE110F18B4AAC235C0C8460BA2'),
    propertyList?: [ 
      {
        name?: string(name='Name', example='TAGS'),
        value?: string(name='Value', example='TagA'),
      }
    ](name='PropertyList'),
    reconsumeTimes?: long(name='ReconsumeTimes', example='1'),
    storeHost?: string(name='StoreHost', example='11.220.***.***:10911'),
    storeSize?: long(name='StoreSize', example='407'),
    storeTimestamp?: long(name='StoreTimestamp', example='1570761026708'),
    topic?: string(name='Topic', example='test-mq_topic'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model GetMqSofamqMessageByIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMqSofamqMessageByIdResponseBody(name='body'),
}

async function getMqSofamqMessageByIdWithOptions(request: GetMqSofamqMessageByIdRequest, runtime: Util.RuntimeOptions): GetMqSofamqMessageByIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.msgId)) {
    body['MsgId'] = request.msgId;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetMqSofamqMessageById',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMqSofamqMessageById(request: GetMqSofamqMessageByIdRequest): GetMqSofamqMessageByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMqSofamqMessageByIdWithOptions(request, runtime);
}

model GetMqSofamqTraceByMsgIdRequest {
  beginTime?: long(name='BeginTime', example='1570852800'),
  cell?: string(name='Cell', example='RZ01A'),
  endTime?: long(name='EndTime', example='1570968000'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  msgId?: string(name='MsgId', example='1E05791C117818B4AAC23B1BB0CE****'),
  topic?: string(name='Topic', example='test'),
}

model GetMqSofamqTraceByMsgIdResponseBody = {
  queryId?: string(name='QueryId', example='272967562652883649157096685****'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model GetMqSofamqTraceByMsgIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMqSofamqTraceByMsgIdResponseBody(name='body'),
}

async function getMqSofamqTraceByMsgIdWithOptions(request: GetMqSofamqTraceByMsgIdRequest, runtime: Util.RuntimeOptions): GetMqSofamqTraceByMsgIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.beginTime)) {
    body['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.msgId)) {
    body['MsgId'] = request.msgId;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetMqSofamqTraceByMsgId',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMqSofamqTraceByMsgId(request: GetMqSofamqTraceByMsgIdRequest): GetMqSofamqTraceByMsgIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMqSofamqTraceByMsgIdWithOptions(request, runtime);
}

model GetMqSofamqTraceResultRequest {
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  queryId?: string(name='QueryId', example='272967562652883649157096685****'),
}

model GetMqSofamqTraceResultResponseBody = {
  data?: {
    createTime?: long(name='CreateTime', example='1570966857000'),
    instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
    msgId?: string(name='MsgId', example='1E05791C117818B4AAC23B1BB0CE****'),
    msgKey?: string(name='MsgKey', example='keyA'),
    queryId?: string(name='QueryId', example='272967562652883649157096685****'),
    status?: string(name='Status', example='finish'),
    topic?: string(name='Topic', example='topic_a'),
    traceList?: [ 
      {
        bornHost?: string(name='BornHost', example='30.5.**.**'),
        cell?: string(name='Cell', example='RZ00A'),
        costTime?: long(name='CostTime', example='24'),
        msgId?: string(name='MsgId', example='0BC1F01800002A9F000000531246****'),
        msgKey?: string(name='MsgKey', example='ORDERID_100'),
        pubGroupName?: string(name='PubGroupName', example='GID_test'),
        pubTime?: long(name='PubTime', example='1570850870478'),
        status?: string(name='Status', example='SEND_SUCCESS'),
        subList?: [ 
          {
            cell?: string(name='Cell', description='cell name', example='RZ00A'),
            clientList?: [ 
              {
                clientHost?: string(name='ClientHost', example='30.5.**.**'),
                costTime?: long(name='CostTime', example='43'),
                reconsumeTimes?: long(name='ReconsumeTimes', example='1'),
                status?: string(name='Status', example='CONSUME_SUCCESS'),
                subGroupName?: string(name='SubGroupName', example='GID_test'),
                subTime?: long(name='SubTime', example='1570851590511'),
              }
            ](name='ClientList'),
            failCount?: long(name='FailCount', example='0'),
            subGroupName?: string(name='SubGroupName', example='GID_test'),
            successCount?: long(name='SuccessCount', example='1'),
          }
        ](name='SubList'),
        tag?: string(name='Tag', example='TagA'),
        topic?: string(name='Topic', example='test'),
      }
    ](name='TraceList'),
    updateTime?: long(name='UpdateTime', example='1570966857000'),
    userId?: string(name='UserId', example='27296756265288****'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model GetMqSofamqTraceResultResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMqSofamqTraceResultResponseBody(name='body'),
}

async function getMqSofamqTraceResultWithOptions(request: GetMqSofamqTraceResultRequest, runtime: Util.RuntimeOptions): GetMqSofamqTraceResultResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.queryId)) {
    body['QueryId'] = request.queryId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetMqSofamqTraceResult',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMqSofamqTraceResult(request: GetMqSofamqTraceResultRequest): GetMqSofamqTraceResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMqSofamqTraceResultWithOptions(request, runtime);
}

model GetMsConfigAttributesRequest {
  id?: long(name='Id', example='1'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
}

model GetMsConfigAttributesResponseBody = {
  attribute?: {
    attributeName?: string(name='AttributeName', example='switch'),
    desc?: string(name='Desc'),
    id?: long(name='Id', example='1'),
    instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  }(name='Attribute'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model GetMsConfigAttributesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMsConfigAttributesResponseBody(name='body'),
}

async function getMsConfigAttributesWithOptions(request: GetMsConfigAttributesRequest, runtime: Util.RuntimeOptions): GetMsConfigAttributesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetMsConfigAttributes',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMsConfigAttributes(request: GetMsConfigAttributesRequest): GetMsConfigAttributesResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMsConfigAttributesWithOptions(request, runtime);
}

model GetMsConfigResourcesRequest {
  id?: long(name='Id', example='1'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
}

model GetMsConfigResourcesResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resource?: {
    appName?: string(name='AppName', example='drmdemo'),
    attributes?: [ 
      {
        attributeName?: string(name='AttributeName', example='switch'),
        desc?: string(name='Desc'),
        id?: long(name='Id', example='1'),
        instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
      }
    ](name='Attributes'),
    desc?: string(name='Desc'),
    id?: long(name='Id', example='1'),
    instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
    region?: string(name='Region', example='Alipay'),
    resourceId?: string(name='ResourceId', example='com.alipay.drmResource'),
  }(name='Resource'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model GetMsConfigResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMsConfigResourcesResponseBody(name='body'),
}

async function getMsConfigResourcesWithOptions(request: GetMsConfigResourcesRequest, runtime: Util.RuntimeOptions): GetMsConfigResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetMsConfigResources',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMsConfigResources(request: GetMsConfigResourcesRequest): GetMsConfigResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMsConfigResourcesWithOptions(request, runtime);
}

model GrayPushMsConfigDataRequest {
  attributeId?: long(name='AttributeId', example='1'),
  data?: string(name='Data', example='hello world'),
  hosts?: string(name='Hosts', example='127.0.0.1,127.0.0.2'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  operator?: string(name='Operator', example='wang.li'),
}

model GrayPushMsConfigDataResponseBody = {
  pushResult?: [ 
    {
      host?: string(name='Host', example='127.0.0.1'),
      success?: boolean(name='Success', example='true'),
    }
  ](name='PushResult'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model GrayPushMsConfigDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GrayPushMsConfigDataResponseBody(name='body'),
}

async function grayPushMsConfigDataWithOptions(request: GrayPushMsConfigDataRequest, runtime: Util.RuntimeOptions): GrayPushMsConfigDataResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.attributeId)) {
    body['AttributeId'] = request.attributeId;
  }
  if (!Util.isUnset(request.data)) {
    body['Data'] = request.data;
  }
  if (!Util.isUnset(request.hosts)) {
    body['Hosts'] = request.hosts;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.operator)) {
    body['Operator'] = request.operator;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GrayPushMsConfigData',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function grayPushMsConfigData(request: GrayPushMsConfigDataRequest): GrayPushMsConfigDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return grayPushMsConfigDataWithOptions(request, runtime);
}

model ListMqSofamqGroupRequest {
  groupId?: string(name='GroupId', example='GID_test_group_id'),
  groupType?: string(name='GroupType'),
  instanceId?: string(name='InstanceId', example='SOFAMQ_INSTANCE_000001'),
  pageNum?: long(name='PageNum', example='1'),
  pageSize?: long(name='PageSize', example='20'),
}

model ListMqSofamqGroupResponseBody = {
  data?: {
    content?: [ 
      {
        cluster?: string(name='Cluster', example='SINGLE'),
        deleteMark?: string(name='DeleteMark'),
        gmtCreate?: long(name='GmtCreate', example='1570966857000'),
        gmtModified?: long(name='GmtModified', example='1570966857000'),
        groupId?: string(name='GroupId', description='Group ID', example='test_group_id'),
        groupType?: string(name='GroupType', example='tcp'),
        id?: long(name='Id', example='1'),
        instanceId?: string(name='InstanceId', example='SOFAMQ_INSTANCE_000001'),
        operator?: string(name='Operator', example='alipay'),
        readEnable?: boolean(name='ReadEnable', example='true'),
        remark?: string(name='Remark', example='test'),
        retryPerm?: long(name='RetryPerm'),
        retryReadQueueNum?: long(name='RetryReadQueueNum'),
        retryWriteQueueNum?: long(name='RetryWriteQueueNum'),
        scope?: string(name='Scope'),
        version?: long(name='Version'),
      }
    ](name='Content'),
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='20'),
    total?: long(name='Total', example='100'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model ListMqSofamqGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListMqSofamqGroupResponseBody(name='body'),
}

async function listMqSofamqGroupWithOptions(request: ListMqSofamqGroupRequest, runtime: Util.RuntimeOptions): ListMqSofamqGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupType)) {
    body['GroupType'] = request.groupType;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListMqSofamqGroup',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listMqSofamqGroup(request: ListMqSofamqGroupRequest): ListMqSofamqGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return listMqSofamqGroupWithOptions(request, runtime);
}

model ListMqSofamqTopicRequest {
  instanceId?: string(name='InstanceId', example='000001'),
  pageNum?: long(name='PageNum', example='1'),
  pageSize?: long(name='PageSize', example='10'),
  topic?: string(name='Topic', example='TP_TEST'),
}

model ListMqSofamqTopicResponseBody = {
  data?: {
    content?: [ 
      {
        cluster?: string(name='Cluster', example='single'),
        gmtCreate?: long(name='GmtCreate', example='1570966857000'),
        gmtModified?: long(name='GmtModified', example='1570966857000'),
        id?: long(name='Id', example='1'),
        instanceId?: string(name='InstanceId', example='000001'),
        messageType?: long(name='MessageType', example='0'),
        operator?: string(name='Operator', example='alipay'),
        perm?: long(name='Perm', example='6'),
        readQueueNum?: long(name='ReadQueueNum', example='8'),
        remark?: string(name='Remark', example='desc'),
        topic?: string(name='Topic', example='TP_TEST'),
        writeQueueNum?: long(name='WriteQueueNum', example='8'),
      }
    ](name='Content'),
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='10'),
    total?: long(name='Total', example='100'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model ListMqSofamqTopicResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListMqSofamqTopicResponseBody(name='body'),
}

async function listMqSofamqTopicWithOptions(request: ListMqSofamqTopicRequest, runtime: Util.RuntimeOptions): ListMqSofamqTopicResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListMqSofamqTopic',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listMqSofamqTopic(request: ListMqSofamqTopicRequest): ListMqSofamqTopicResponse {
  var runtime = new Util.RuntimeOptions{};
  return listMqSofamqTopicWithOptions(request, runtime);
}

model ListMqSofamqTraceRequest {
  instanceId?: string(name='InstanceId', example='SOFAMQ_INSTANCE_000001'),
  pageNum?: long(name='PageNum', example='1'),
  pageSize?: long(name='PageSize', example='20'),
  queryItem?: string(name='QueryItem', example='TP_xx，0BA6EEBD700549C2FAAE076616860003，keyA'),
}

model ListMqSofamqTraceResponseBody = {
  data?: {
    content?: [ 
      {
        cell?: string(name='Cell', example='RZ001'),
        gmtCreate?: long(name='GmtCreate', example='1570701259403'),
        gmtModified?: long(name='GmtModified', example='1570701259403'),
        instanceId?: string(name='InstanceId', example='SOFAMQ_INSTANCE_000001'),
        msgId?: string(name='MsgId', example='1E05791C117818B4AAC23B1BB0CE****'),
        msgKey?: string(name='MsgKey', example='ORDERID_100'),
        queryId?: string(name='QueryId', example='272967562652883649157096685****'),
        status?: string(name='Status', example='QUERYING'),
        topic?: string(name='Topic', example='TP_xxx'),
      }
    ](name='Content'),
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='20'),
    total?: long(name='Total', example='100'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model ListMqSofamqTraceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListMqSofamqTraceResponseBody(name='body'),
}

async function listMqSofamqTraceWithOptions(request: ListMqSofamqTraceRequest, runtime: Util.RuntimeOptions): ListMqSofamqTraceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.queryItem)) {
    body['QueryItem'] = request.queryItem;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListMqSofamqTrace',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listMqSofamqTrace(request: ListMqSofamqTraceRequest): ListMqSofamqTraceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listMqSofamqTraceWithOptions(request, runtime);
}

model ListMqSofamqWarnRequest {
  groupId?: string(name='GroupId', example='GID_group'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  pageNum?: long(name='PageNum', example='1'),
  pageSize?: long(name='PageSize', example='20'),
  topic?: string(name='Topic', example='test'),
}

model ListMqSofamqWarnResponseBody = {
  data?: {
    content?: [ 
      {
        alertTime?: string(name='AlertTime', example='00:00-23:59'),
        attribute?: string(name='Attribute', example='""'),
        blockTime?: long(name='BlockTime', example='10'),
        contacts?: string(name='Contacts'),
        delayTime?: long(name='DelayTime', example='5'),
        frequency?: long(name='Frequency', example='10'),
        gmtCreate?: long(name='GmtCreate', example='1570701259403'),
        gmtModified?: long(name='GmtModified', example='1570701259403'),
        groupId?: string(name='GroupId', example='GID_TEST'),
        id?: long(name='Id', example='1'),
        instanceId?: string(name='InstanceId', example='SOFAMQ_INSTANCE_000001'),
        operator?: string(name='Operator', example='alipay'),
        threshold?: long(name='Threshold', example='3000'),
        topic?: string(name='Topic', example='TP_TEST'),
        warnLevel?: long(name='WarnLevel', example='5'),
        warnStatus?: long(name='WarnStatus', example='1'),
        warnType?: long(name='WarnType', example='1'),
      }
    ](name='Content'),
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='20'),
    total?: long(name='Total', example='100'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model ListMqSofamqWarnResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListMqSofamqWarnResponseBody(name='body'),
}

async function listMqSofamqWarnWithOptions(request: ListMqSofamqWarnRequest, runtime: Util.RuntimeOptions): ListMqSofamqWarnResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListMqSofamqWarn',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listMqSofamqWarn(request: ListMqSofamqWarnRequest): ListMqSofamqWarnResponse {
  var runtime = new Util.RuntimeOptions{};
  return listMqSofamqWarnWithOptions(request, runtime);
}

model ListMqSofamqWarnHistoryRequest {
  cell?: string(name='Cell', example='RZ00A'),
  groupId?: string(name='GroupId', description='Group ID', example='GID_TEST'),
  instanceId?: string(name='InstanceId', example='INSTANCE_XXX'),
  pageNum?: long(name='PageNum', example='1'),
  pageSize?: long(name='PageSize', example='20'),
  topic?: string(name='Topic', example='TP_TEST'),
  warnId?: long(name='WarnId', example='4'),
}

model ListMqSofamqWarnHistoryResponseBody = {
  data?: {
    content?: [ 
      {
        cell?: string(name='Cell', example='RZ00A'),
        gmtCreate?: long(name='GmtCreate', example='1570701259403'),
        gmtModified?: long(name='GmtModified', example='1570701259403'),
        groupId?: string(name='GroupId', description='Group ID', example='GID_TEST'),
        instanceId?: string(name='InstanceId', example='SOFAMQ_INSTANCE_000001'),
        topic?: string(name='Topic', example='TP_TEST'),
        warnId?: long(name='WarnId', example='1'),
        warnInfo?: string(name='WarnInfo'),
      }
    ](name='Content'),
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='20'),
    total?: long(name='Total', example='10'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model ListMqSofamqWarnHistoryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListMqSofamqWarnHistoryResponseBody(name='body'),
}

async function listMqSofamqWarnHistoryWithOptions(request: ListMqSofamqWarnHistoryRequest, runtime: Util.RuntimeOptions): ListMqSofamqWarnHistoryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  if (!Util.isUnset(request.warnId)) {
    body['WarnId'] = request.warnId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListMqSofamqWarnHistory',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listMqSofamqWarnHistory(request: ListMqSofamqWarnHistoryRequest): ListMqSofamqWarnHistoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return listMqSofamqWarnHistoryWithOptions(request, runtime);
}

model LogoutMsRegistryServiceRequest {
  instanceId?: string(name='InstanceId'),
  serverIpsRepeatList?: [ string ](name='ServerIpsRepeatList'),
}

model LogoutMsRegistryServiceResponseBody = {
  requestId?: string(name='RequestId'),
  resultCode?: string(name='ResultCode'),
  resultMessage?: string(name='ResultMessage'),
}

model LogoutMsRegistryServiceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: LogoutMsRegistryServiceResponseBody(name='body'),
}

async function logoutMsRegistryServiceWithOptions(request: LogoutMsRegistryServiceRequest, runtime: Util.RuntimeOptions): LogoutMsRegistryServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.serverIpsRepeatList)) {
    body['ServerIpsRepeatList'] = request.serverIpsRepeatList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'LogoutMsRegistryService',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function logoutMsRegistryService(request: LogoutMsRegistryServiceRequest): LogoutMsRegistryServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return logoutMsRegistryServiceWithOptions(request, runtime);
}

model PushMsConfigDataRequest {
  attributeId?: long(name='AttributeId', example='1'),
  cells?: string(name='Cells', example='Cell1,Cell2'),
  data?: string(name='Data', example='12'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  operator?: string(name='Operator', example='wang.li'),
}

model PushMsConfigDataResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model PushMsConfigDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PushMsConfigDataResponseBody(name='body'),
}

async function pushMsConfigDataWithOptions(request: PushMsConfigDataRequest, runtime: Util.RuntimeOptions): PushMsConfigDataResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.attributeId)) {
    body['AttributeId'] = request.attributeId;
  }
  if (!Util.isUnset(request.cells)) {
    body['Cells'] = request.cells;
  }
  if (!Util.isUnset(request.data)) {
    body['Data'] = request.data;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.operator)) {
    body['Operator'] = request.operator;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PushMsConfigData',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function pushMsConfigData(request: PushMsConfigDataRequest): PushMsConfigDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return pushMsConfigDataWithOptions(request, runtime);
}

model QueryMqSofamqConsumerAccumulateRequest {
  cell?: string(name='Cell', example='RZ01A'),
  detail?: boolean(name='Detail', example='true'),
  groupId?: string(name='GroupId', example='GID_test_consumer_id'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
}

model QueryMqSofamqConsumerAccumulateResponseBody = {
  data?: {
    consumeTps?: string(name='ConsumeTps', example='10'),
    delayTime?: long(name='DelayTime', example='10000'),
    detailInTopicList?: [ 
      {
        delayTime?: long(name='DelayTime', example='0'),
        lastTimestamp?: long(name='LastTimestamp', example='1570701259403'),
        topic?: string(name='Topic', example='test-mq_topic'),
        totalDiff?: long(name='TotalDiff', example='0'),
      }
    ](name='DetailInTopicList'),
    lastTimestamp?: long(name='LastTimestamp', example='1566231000000'),
    online?: boolean(name='Online', example='true'),
    totalDiff?: long(name='TotalDiff', example='100'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMqSofamqConsumerAccumulateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMqSofamqConsumerAccumulateResponseBody(name='body'),
}

async function queryMqSofamqConsumerAccumulateWithOptions(request: QueryMqSofamqConsumerAccumulateRequest, runtime: Util.RuntimeOptions): QueryMqSofamqConsumerAccumulateResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.detail)) {
    body['Detail'] = request.detail;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMqSofamqConsumerAccumulate',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMqSofamqConsumerAccumulate(request: QueryMqSofamqConsumerAccumulateRequest): QueryMqSofamqConsumerAccumulateResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMqSofamqConsumerAccumulateWithOptions(request, runtime);
}

model QueryMqSofamqConsumerConnectionRequest {
  cell?: string(name='Cell', example='RZ01A'),
  groupId?: string(name='GroupId', example='GID_test_consumer_id'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
}

model QueryMqSofamqConsumerConnectionResponseBody = {
  data?: {
    connectionList?: [ 
      {
        clientAddr?: string(name='ClientAddr', example='30.5.121.**'),
        clientId?: string(name='ClientId', example='30.5.121.**@25560#-1999745829#-1737591554#458773089270275'),
        language?: string(name='Language', example='JAVA'),
        remoteIp?: string(name='RemoteIp', example='42.120.74.**'),
        version?: string(name='Version', example='V4_3_6_SNAPSHOT'),
      }
    ](name='ConnectionList'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMqSofamqConsumerConnectionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMqSofamqConsumerConnectionResponseBody(name='body'),
}

async function queryMqSofamqConsumerConnectionWithOptions(request: QueryMqSofamqConsumerConnectionRequest, runtime: Util.RuntimeOptions): QueryMqSofamqConsumerConnectionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMqSofamqConsumerConnection',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMqSofamqConsumerConnection(request: QueryMqSofamqConsumerConnectionRequest): QueryMqSofamqConsumerConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMqSofamqConsumerConnectionWithOptions(request, runtime);
}

model QueryMqSofamqConsumerTimespanRequest {
  cell?: string(name='Cell', example='RZ01A'),
  groupId?: string(name='GroupId', example='GID_test_group_id'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  topic?: string(name='Topic', example='test-mq_topic'),
}

model QueryMqSofamqConsumerTimespanResponseBody = {
  data?: {
    consumeTimestamp?: long(name='ConsumeTimestamp', example='1570761026400'),
    instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
    maxTimestamp?: long(name='MaxTimestamp', example='1570761026804'),
    minTimestamp?: long(name='MinTimestamp', example='1570701231122'),
    topic?: string(name='Topic', example='test-mq_topic'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMqSofamqConsumerTimespanResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMqSofamqConsumerTimespanResponseBody(name='body'),
}

async function queryMqSofamqConsumerTimespanWithOptions(request: QueryMqSofamqConsumerTimespanRequest, runtime: Util.RuntimeOptions): QueryMqSofamqConsumerTimespanResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMqSofamqConsumerTimespan',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMqSofamqConsumerTimespan(request: QueryMqSofamqConsumerTimespanRequest): QueryMqSofamqConsumerTimespanResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMqSofamqConsumerTimespanWithOptions(request, runtime);
}

model QueryMqSofamqDLQMessageByGroupIdRequest {
  beginTime?: long(name='BeginTime', example='1570723200000'),
  cell?: string(name='Cell', example='RZ01A'),
  endTime?: long(name='EndTime', example='1570809600000'),
  groupId?: string(name='GroupId', example='GID_test_group_id'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  pageNum?: long(name='PageNum', example='1'),
  pageSize?: long(name='PageSize', example='10'),
  taskId?: string(name='TaskId', example='0BC1310300002A9F000021E4D7A48346'),
}

model QueryMqSofamqDLQMessageByGroupIdResponseBody = {
  data?: {
    content?: [ 
      {
        body?: string(name='Body', example='SGVsbG8gTVEg5raT7oWf5p6D5ai05ayt55iv'),
        bodyCrc?: long(name='BodyCrc', example='914112295'),
        bornHost?: string(name='BornHost', example='42.120.**.**:64646'),
        bornTimestamp?: long(name='BornTimestamp', example='1570761026630'),
        instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
        msgId?: string(name='MsgId', example='1E0578FE110F18B4AAC235C0C8460BA2'),
        propertyList?: [ 
          {
            name?: string(name='Name', example='TAGS'),
            value?: string(name='Value', example='TagA'),
          }
        ](name='PropertyList'),
        reconsumeTimes?: long(name='ReconsumeTimes', example='1'),
        storeHost?: string(name='StoreHost', example='11.220.***.***:10911'),
        storeSize?: long(name='StoreSize', example='407'),
        storeTimestamp?: long(name='StoreTimestamp', example='1570761026708'),
        topic?: string(name='Topic', example='test-mq_topic'),
      }
    ](name='Content'),
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='10'),
    taskId?: string(name='TaskId', example='0BC1310300002A9F000021E4D7A48346'),
    total?: long(name='Total', example='100'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMqSofamqDLQMessageByGroupIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMqSofamqDLQMessageByGroupIdResponseBody(name='body'),
}

async function queryMqSofamqDLQMessageByGroupIdWithOptions(request: QueryMqSofamqDLQMessageByGroupIdRequest, runtime: Util.RuntimeOptions): QueryMqSofamqDLQMessageByGroupIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.beginTime)) {
    body['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMqSofamqDLQMessageByGroupId',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMqSofamqDLQMessageByGroupId(request: QueryMqSofamqDLQMessageByGroupIdRequest): QueryMqSofamqDLQMessageByGroupIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMqSofamqDLQMessageByGroupIdWithOptions(request, runtime);
}

model QueryMqSofamqGroupSubDetailRequest {
  cell?: string(name='Cell', example='RZ01A'),
  groupId?: string(name='GroupId', example='GID_test_group_id'),
  instanceId?: string(name='InstanceId', example='SOFAMQ_INSTANCE_000001'),
}

model QueryMqSofamqGroupSubDetailResponseBody = {
  data?: {
    groupId?: string(name='GroupId', description='Group ID', example='GID_test_group_id'),
    messageModel?: string(name='MessageModel', example='CLUSTERING'),
    online?: boolean(name='Online', example='true'),
    subscriptionDataList?: [ 
      {
        online?: boolean(name='Online', example='true'),
        subString?: string(name='SubString', example='*'),
        topic?: string(name='Topic', example='test-mq_topic'),
      }
    ](name='SubscriptionDataList'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMqSofamqGroupSubDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMqSofamqGroupSubDetailResponseBody(name='body'),
}

async function queryMqSofamqGroupSubDetailWithOptions(request: QueryMqSofamqGroupSubDetailRequest, runtime: Util.RuntimeOptions): QueryMqSofamqGroupSubDetailResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMqSofamqGroupSubDetail',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMqSofamqGroupSubDetail(request: QueryMqSofamqGroupSubDetailRequest): QueryMqSofamqGroupSubDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMqSofamqGroupSubDetailWithOptions(request, runtime);
}

model QueryMqSofamqMessageByKeyRequest {
  cell?: string(name='Cell', example='RZ01A'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  key?: string(name='Key', example='messageKey1'),
  topic?: string(name='Topic', example='test-mq_topic'),
}

model QueryMqSofamqMessageByKeyResponseBody = {
  data?: [ 
    {
      body?: string(name='Body', example='SGVsbG8gTVEg5raT7oWf5p6D5ai05ayt55iv'),
      bodyCrc?: long(name='BodyCrc', example='914112295'),
      bornHost?: string(name='BornHost', example='42.120.**.**:64646'),
      bornTimestamp?: long(name='BornTimestamp', example='1570761026630'),
      instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
      msgId?: string(name='MsgId', example='1E0578FE110F18B4AAC235C0C8460BA2'),
      propertyList?: [ 
        {
          name?: string(name='Name', example='TAGS'),
          value?: string(name='Value', example='TagA'),
        }
      ](name='PropertyList'),
      reconsumeTimes?: long(name='ReconsumeTimes', example='1'),
      storeHost?: string(name='StoreHost', example='11.220.***.***:10911'),
      storeSize?: long(name='StoreSize', example='407'),
      storeTimestamp?: long(name='StoreTimestamp', example='1570761026708'),
      topic?: string(name='Topic', example='test-mq_topic'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMqSofamqMessageByKeyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMqSofamqMessageByKeyResponseBody(name='body'),
}

async function queryMqSofamqMessageByKeyWithOptions(request: QueryMqSofamqMessageByKeyRequest, runtime: Util.RuntimeOptions): QueryMqSofamqMessageByKeyResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.key)) {
    body['Key'] = request.key;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMqSofamqMessageByKey',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMqSofamqMessageByKey(request: QueryMqSofamqMessageByKeyRequest): QueryMqSofamqMessageByKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMqSofamqMessageByKeyWithOptions(request, runtime);
}

model QueryMqSofamqMessageByTopicRequest {
  beginTime?: long(name='BeginTime', example='1570723200000'),
  cell?: string(name='Cell', example='RZ01A'),
  endTime?: long(name='EndTime', example='1570809600000'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  pageNum?: long(name='PageNum', example='1'),
  pageSize?: long(name='PageSize', example='20'),
  taskId?: string(name='TaskId', example='0BC1310300002A9F000021E4D7A48346'),
  topic?: string(name='Topic', example='test-mq_topic'),
}

model QueryMqSofamqMessageByTopicResponseBody = {
  data?: {
    content?: [ 
      {
        body?: string(name='Body', example='SGVsbG8gTVEg5raT7oWf5p6D5ai05ayt55iv'),
        bodyCrc?: long(name='BodyCrc', example='914112295'),
        bornHost?: string(name='BornHost', example='42.120.**.**:64646'),
        bornTimestamp?: long(name='BornTimestamp', example='1570761026630'),
        instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
        msgId?: string(name='MsgId', example='1E0578FE110F18B4AAC235C0C8460BA2'),
        propertyList?: [ 
          {
            name?: string(name='Name', example='TAGS'),
            value?: string(name='Value', example='TagA'),
          }
        ](name='PropertyList'),
        reconsumeTimes?: long(name='ReconsumeTimes', example='1'),
        storeHost?: string(name='StoreHost', example='11.220.***.***:10911'),
        storeSize?: long(name='StoreSize', example='407'),
        storeTimestamp?: long(name='StoreTimestamp', example='1570761026708'),
        topic?: string(name='Topic', example='test-mq_topic'),
      }
    ](name='Content'),
    pageNum?: long(name='PageNum', example='1'),
    pageSize?: long(name='PageSize', example='10'),
    taskId?: string(name='TaskId', example='0BC1310300002A9F000021E4D7A48346'),
    total?: long(name='Total', example='100'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMqSofamqMessageByTopicResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMqSofamqMessageByTopicResponseBody(name='body'),
}

async function queryMqSofamqMessageByTopicWithOptions(request: QueryMqSofamqMessageByTopicRequest, runtime: Util.RuntimeOptions): QueryMqSofamqMessageByTopicResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.beginTime)) {
    body['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMqSofamqMessageByTopic',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMqSofamqMessageByTopic(request: QueryMqSofamqMessageByTopicRequest): QueryMqSofamqMessageByTopicResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMqSofamqMessageByTopicWithOptions(request, runtime);
}

model QueryMqSofamqTraceByMsgKeyRequest {
  beginTime?: long(name='BeginTime', example='1570852800'),
  cell?: string(name='Cell', example='RZ01A'),
  endTime?: long(name='EndTime', example='1570968000'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  msgKey?: string(name='MsgKey', example='ORDERID_100'),
  topic?: string(name='Topic', example='test'),
}

model QueryMqSofamqTraceByMsgKeyResponseBody = {
  queryId?: string(name='QueryId', example='272967562652883649157096685****'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMqSofamqTraceByMsgKeyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMqSofamqTraceByMsgKeyResponseBody(name='body'),
}

async function queryMqSofamqTraceByMsgKeyWithOptions(request: QueryMqSofamqTraceByMsgKeyRequest, runtime: Util.RuntimeOptions): QueryMqSofamqTraceByMsgKeyResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.beginTime)) {
    body['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.msgKey)) {
    body['MsgKey'] = request.msgKey;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMqSofamqTraceByMsgKey',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMqSofamqTraceByMsgKey(request: QueryMqSofamqTraceByMsgKeyRequest): QueryMqSofamqTraceByMsgKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMqSofamqTraceByMsgKeyWithOptions(request, runtime);
}

model QueryMqSofamqTraceByTopicRequest {
  beginTime?: long(name='BeginTime', example='1568033253'),
  cell?: string(name='Cell', example='RZ01A'),
  endTime?: long(name='EndTime', example='1568133253'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  topic?: string(name='Topic', example='TP_xxx'),
}

model QueryMqSofamqTraceByTopicResponseBody = {
  queryId?: string(name='QueryId', example='272967562652883649157096685****'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMqSofamqTraceByTopicResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMqSofamqTraceByTopicResponseBody(name='body'),
}

async function queryMqSofamqTraceByTopicWithOptions(request: QueryMqSofamqTraceByTopicRequest, runtime: Util.RuntimeOptions): QueryMqSofamqTraceByTopicResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.beginTime)) {
    body['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMqSofamqTraceByTopic',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMqSofamqTraceByTopic(request: QueryMqSofamqTraceByTopicRequest): QueryMqSofamqTraceByTopicResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMqSofamqTraceByTopicWithOptions(request, runtime);
}

model QueryMsConfigAttributesRequest {
  appName?: string(name='AppName', example='demo-app'),
  attributeName?: string(name='AttributeName', example='age'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  region?: string(name='Region', example='Alipay'),
  resourceId?: string(name='ResourceId', example='com.alipay.test'),
}

model QueryMsConfigAttributesResponseBody = {
  attribute?: {
    attributeName?: string(name='AttributeName', example='switch'),
    desc?: string(name='Desc'),
    id?: long(name='Id', example='1'),
    instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  }(name='Attribute'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMsConfigAttributesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMsConfigAttributesResponseBody(name='body'),
}

async function queryMsConfigAttributesWithOptions(request: QueryMsConfigAttributesRequest, runtime: Util.RuntimeOptions): QueryMsConfigAttributesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.attributeName)) {
    body['AttributeName'] = request.attributeName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.region)) {
    body['Region'] = request.region;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMsConfigAttributes',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMsConfigAttributes(request: QueryMsConfigAttributesRequest): QueryMsConfigAttributesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMsConfigAttributesWithOptions(request, runtime);
}

model QueryMsConfigClientValuesRequest {
  attributeId?: long(name='AttributeId', example='1'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  ips?: string(name='Ips', example='127.0.0.1,127.0.0.2'),
}

model QueryMsConfigClientValuesResponseBody = {
  clients?: [ 
    {
      data?: string(name='Data', example='switch'),
      ip?: string(name='Ip', example='127.0.0.1'),
      success?: boolean(name='Success', example='true'),
    }
  ](name='Clients'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMsConfigClientValuesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMsConfigClientValuesResponseBody(name='body'),
}

async function queryMsConfigClientValuesWithOptions(request: QueryMsConfigClientValuesRequest, runtime: Util.RuntimeOptions): QueryMsConfigClientValuesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.attributeId)) {
    body['AttributeId'] = request.attributeId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ips)) {
    body['Ips'] = request.ips;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMsConfigClientValues',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMsConfigClientValues(request: QueryMsConfigClientValuesRequest): QueryMsConfigClientValuesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMsConfigClientValuesWithOptions(request, runtime);
}

model QueryMsConfigClientsRequest {
  attributeId?: long(name='AttributeId', example='1'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  pageNum?: long(name='PageNum', example='1'),
  pageSize?: string(name='PageSize', example='10'),
}

model QueryMsConfigClientsResponseBody = {
  clients?: [ 
    {
      cell?: string(name='Cell', example='DEFAULT'),
      data?: string(name='Data', example='switch'),
      ip?: string(name='Ip', example='127.0.0.1'),
      pushData?: string(name='PushData', example='switch'),
    }
  ](name='Clients'),
  pageNum?: long(name='PageNum', example='1'),
  pageSize?: long(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
  totalCount?: long(name='TotalCount', example='100'),
}

model QueryMsConfigClientsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMsConfigClientsResponseBody(name='body'),
}

async function queryMsConfigClientsWithOptions(request: QueryMsConfigClientsRequest, runtime: Util.RuntimeOptions): QueryMsConfigClientsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.attributeId)) {
    body['AttributeId'] = request.attributeId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMsConfigClients',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMsConfigClients(request: QueryMsConfigClientsRequest): QueryMsConfigClientsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMsConfigClientsWithOptions(request, runtime);
}

model QueryMsConfigDataRequest {
  attributeId?: long(name='AttributeId', example='1'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
}

model QueryMsConfigDataResponseBody = {
  queryResult?: [ 
    {
      cell?: string(name='Cell', example='cell1'),
      data?: string(name='Data', example='some push data'),
    }
  ](name='QueryResult'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model QueryMsConfigDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMsConfigDataResponseBody(name='body'),
}

async function queryMsConfigDataWithOptions(request: QueryMsConfigDataRequest, runtime: Util.RuntimeOptions): QueryMsConfigDataResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.attributeId)) {
    body['AttributeId'] = request.attributeId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMsConfigData',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMsConfigData(request: QueryMsConfigDataRequest): QueryMsConfigDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMsConfigDataWithOptions(request, runtime);
}

model QueryMsConfigResourcesRequest {
  appName?: string(name='AppName', example='foo'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  keyword?: string(name='Keyword', example='com.alipay.drmResource'),
  pageNum?: long(name='PageNum', example='1'),
  pageSize?: string(name='PageSize', example='10'),
}

model QueryMsConfigResourcesResponseBody = {
  pageNum?: long(name='PageNum', example='1'),
  pageSize?: long(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resources?: [ 
    {
      appName?: string(name='AppName', example='drmdemo'),
      attributes?: [ 
        {
          attributeName?: string(name='AttributeName', example='switch'),
          desc?: string(name='Desc'),
          id?: long(name='Id', example='1'),
          instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
        }
      ](name='Attributes'),
      desc?: string(name='Desc'),
      id?: long(name='Id', example='1'),
      instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
      region?: string(name='Region', example='Alipay'),
      resourceId?: string(name='ResourceId', example='com.alipay.drmResource'),
    }
  ](name='Resources'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
  totalCount?: long(name='TotalCount', example='100'),
}

model QueryMsConfigResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryMsConfigResourcesResponseBody(name='body'),
}

async function queryMsConfigResourcesWithOptions(request: QueryMsConfigResourcesRequest, runtime: Util.RuntimeOptions): QueryMsConfigResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.keyword)) {
    body['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryMsConfigResources',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryMsConfigResources(request: QueryMsConfigResourcesRequest): QueryMsConfigResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMsConfigResourcesWithOptions(request, runtime);
}

model QueryRMSMetricsRequest {
  contentType?: string(name='ContentType', example='INDEXABLE_MULTI_KEY_STAT'),
  dsId?: string(name='DsId', example='2643'),
  end?: long(name='End', example='1632278280000'),
  fieldsRepeatList?: [ string ](name='FieldsRepeatList'),
  periodType?: string(name='PeriodType'),
  plugin?: string(name='Plugin', example='SM'),
  start?: long(name='Start', example='1636308360000'),
  where?: [ 
    {
      key?: string(name='Key', example='app'),
      value?: string(name='Value', example='monitorprod'),
    }
  ](name='Where'),
  workspaceName?: string(name='WorkspaceName', example='prod'),
}

model QueryRMSMetricsResponseBody = {
  requestId?: string(name='RequestId', example='38D23571-2FDD-5A3B-AF04-15A30B96D11B'),
  result?: string(name='Result', example='{"success":true,"message":"query ok, time cost: 33ms, pontus@{}","data":[{"tags":{},"datasByTime":{"1646014620000":[18730.0],"1646012400000":[17849.0],"1646010180000":[17860.0],"1646014140000":[18832.0],"1646011920000":[17843.0],"1646013660000":[17799.0],"1646011440000":[17803.0],"1646015400000":[17988.0],"1646013180000":[17851.0],"1646010960000":[17895.0],"1646014920000":[17628.0],"1646012700000":[17937.0],"1646010480000":[17757.0],"1646012580000":[17815.0],"1646014440000":[17785.0],"1646010000000":[17791.0],"1646012100000":[17785.0],"1646013960000":[17895.0],"1646011620000":[17822.0],"1646013480000":[17809.0],"1646015580000":[18780.0],"1646011140000":[17805.0],"1646013000000":[17682.0],"1646015100000":[18924.0],"1646010660000":[17819.0],"1646010540000":[17653.0],"1646014740000":[17848.0],"1646012280000":[17861.0],"1646010060000":[17787.0],"1646014260000":[17770.0],"1646011800000":[17990.0],"1646013780000":[17942.0],"1646011320000":[17749.0],"1646015520000":[18159.0],"1646013300000":[17889.0],"1646010840000":[17755.0],"1646015040000":[18836.0],"1646012820000":[17878.0],"1646010360000":[17829.0],"1646012460000":[17896.0],"1646014560000":[18979.0],"1646009880000":[17798.0],"1646011980000":[17806.0],"1646014080000":[17337.0],"1646011500000":[17801.0],"1646013600000":[17940.0],"1646015700000":[17885.0],"1646015220000":[18172.0],"1646011020000":[17757.0],"1646013120000":[17650.0],"1646012640000":[17825.0],"1646010420000":[17767.0],"1646014380000":[17769.0],"1646012160000":[17806.0],"1646009940000":[17769.0],"1646013900000":[17789.0],"1646011680000":[17808.0],"1646015640000":[17905.0],"1646013420000":[17888.0],"1646011200000":[17782.0],"1646015160000":[17304.0],"1646012940000":[17807.0],"1646010720000":[17821.0],"1646014680000":[17759.0],"1646010240000":[17749.0],"1646012340000":[17826.0],"1646014200000":[18874.0],"1646011860000":[17909.0],"1646013720000":[17905.0],"1646015820000":[null],"1646011380000":[17792.0],"1646013240000":[17841.0],"1646015340000":[17853.0],"1646010900000":[17811.0],"1646012760000":[17831.0],"1646014860000":[18881.0],"1646012520000":[17836.0],"1646014500000":[17888.0],"1646010300000":[17793.0],"1646012040000":[17745.0],"1646009820000":[17785.0],"1646014020000":[18936.0],"1646011560000":[17805.0],"1646015760000":[17891.0],"1646013540000":[17843.0],"1646011080000":[17773.0],"1646015280000":[18916.0],"1646013060000":[17858.0],"1646010600000":[17774.0],"1646014800000":[18913.0],"1646010120000":[17848.0],"1646012220000":[17738.0],"1646014320000":[17758.0],"1646011740000":[17766.0],"1646013840000":[17811.0],"1646011260000":[17764.0],"1646013360000":[17872.0],"1646015460000":[17721.0],"1646010780000":[17763.0],"1646012880000":[17821.0],"1646014980000":[17770.0]},"dataMapByTime":{}}],"ip":"11.124.205.28","attend":{"attends":{"FIN-PAAS-DEV":{"expect":30.0,"actual":30.0}},"attendsByIdc":{"FIN-PAAS-DEV":{"1646015760000":{"expect":2.0,"actual":2.0},"1646015700000":{"expect":2.0,"actual":2.0},"1646015640000":{"expect":2.0,"actual":2.0},"1646015580000":{"expect":2.0,"actual":2.0},"1646015520000":{"expect":2.0,"actual":2.0},"1646015460000":{"expect":2.0,"actual":2.0},"1646015400000":{"expect":2.0,"actual":2.0},"1646015340000":{"expect":2.0,"actual":2.0},"1646015220000":{"expect":2.0,"actual":2.0},"1646015280000":{"expect":2.0,"actual":2.0},"1646015160000":{"expect":2.0,"actual":2.0},"1646015100000":{"expect":2.0,"actual":2.0},"1646015040000":{"expect":2.0,"actual":2.0},"1646014980000":{"expect":2.0,"actual":2.0},"1646014920000":{"expect":2.0,"actual":2.0}}}}}'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='""'),
}

model QueryRMSMetricsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryRMSMetricsResponseBody(name='body'),
}

async function queryRMSMetricsWithOptions(request: QueryRMSMetricsRequest, runtime: Util.RuntimeOptions): QueryRMSMetricsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.contentType)) {
    body['ContentType'] = request.contentType;
  }
  if (!Util.isUnset(request.dsId)) {
    body['DsId'] = request.dsId;
  }
  if (!Util.isUnset(request.end)) {
    body['End'] = request.end;
  }
  if (!Util.isUnset(request.fieldsRepeatList)) {
    body['FieldsRepeatList'] = request.fieldsRepeatList;
  }
  if (!Util.isUnset(request.periodType)) {
    body['PeriodType'] = request.periodType;
  }
  if (!Util.isUnset(request.plugin)) {
    body['Plugin'] = request.plugin;
  }
  if (!Util.isUnset(request.start)) {
    body['Start'] = request.start;
  }
  if (!Util.isUnset(request.where)) {
    body['Where'] = request.where;
  }
  if (!Util.isUnset(request.workspaceName)) {
    body['WorkspaceName'] = request.workspaceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryRMSMetrics',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRMSMetrics(request: QueryRMSMetricsRequest): QueryRMSMetricsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRMSMetricsWithOptions(request, runtime);
}

model QueryRMSUnifiedAlarmEventRequest {
  alarmLevel?: long(name='AlarmLevel'),
  alarmRuleId?: long(name='AlarmRuleId'),
  alarmRuleUuid?: string(name='AlarmRuleUuid'),
  alarmStackInfoJsonStr?: string(name='AlarmStackInfoJsonStr'),
  alarmStatusRepeatList?: [ long ](name='AlarmStatusRepeatList'),
  alarmTargetKeyword?: string(name='AlarmTargetKeyword'),
  alarmTargetType?: string(name='AlarmTargetType'),
  currentPage?: long(name='CurrentPage'),
  endTime?: long(name='EndTime'),
  keyword?: string(name='Keyword'),
  pageSize?: long(name='PageSize'),
  startTime?: long(name='StartTime'),
  status?: long(name='Status'),
  workspaceName?: string(name='WorkspaceName'),
}

model QueryRMSUnifiedAlarmEventResponseBody = {
  currentPage?: long(name='CurrentPage'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  resultCode?: string(name='ResultCode'),
  resultMessage?: string(name='ResultMessage'),
  totalCount?: long(name='TotalCount'),
  unifiedAlarmEventList?: [ 
    {
      alarmContent?: string(name='AlarmContent'),
      alarmEventId?: string(name='AlarmEventId'),
      alarmHistoryId?: long(name='AlarmHistoryId'),
      alarmHistoryList?: [ 
        {
          alarmContent?: string(name='AlarmContent'),
          alarmDetail?: string(name='AlarmDetail'),
          alarmLevel?: long(name='AlarmLevel'),
          alarmRuleId?: long(name='AlarmRuleId'),
          alarmRuleName?: string(name='AlarmRuleName'),
          alarmTarget?: string(name='AlarmTarget'),
          alarmTargetDeleted?: boolean(name='AlarmTargetDeleted'),
          alarmTargetType?: string(name='AlarmTargetType'),
          alarmTime?: long(name='AlarmTime'),
          alarmType?: string(name='AlarmType'),
          alarmUrl?: string(name='AlarmUrl'),
          alarmUrlWithDomain?: string(name='AlarmUrlWithDomain'),
          dataSourceName?: string(name='DataSourceName'),
          eventId?: string(name='EventId'),
          gmtCreate?: string(name='GmtCreate'),
          gmtModified?: string(name='GmtModified'),
          id?: long(name='Id'),
          status?: long(name='Status'),
          tenantId?: long(name='TenantId'),
          uniqueIdentity?: string(name='UniqueIdentity'),
          workspaceId?: long(name='WorkspaceId'),
        }
      ](name='AlarmHistoryList'),
      alarmLevel?: long(name='AlarmLevel'),
      alarmRecoverTime?: string(name='AlarmRecoverTime'),
      alarmRuleId?: long(name='AlarmRuleId'),
      alarmStartTime?: string(name='AlarmStartTime'),
      alarmTarget?: string(name='AlarmTarget'),
      alarmTargetDeleted?: boolean(name='AlarmTargetDeleted'),
      alarmTargetType?: string(name='AlarmTargetType'),
      alarmType?: string(name='AlarmType'),
      alarmUrl?: string(name='AlarmUrl'),
      alarmUrlWithDomain?: string(name='AlarmUrlWithDomain'),
      dataSourceName?: string(name='DataSourceName'),
      silenceRemainTime?: long(name='SilenceRemainTime'),
      status?: long(name='Status'),
    }
  ](name='UnifiedAlarmEventList'),
}

model QueryRMSUnifiedAlarmEventResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryRMSUnifiedAlarmEventResponseBody(name='body'),
}

async function queryRMSUnifiedAlarmEventWithOptions(request: QueryRMSUnifiedAlarmEventRequest, runtime: Util.RuntimeOptions): QueryRMSUnifiedAlarmEventResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.alarmLevel)) {
    body['AlarmLevel'] = request.alarmLevel;
  }
  if (!Util.isUnset(request.alarmRuleId)) {
    body['AlarmRuleId'] = request.alarmRuleId;
  }
  if (!Util.isUnset(request.alarmRuleUuid)) {
    body['AlarmRuleUuid'] = request.alarmRuleUuid;
  }
  if (!Util.isUnset(request.alarmStackInfoJsonStr)) {
    body['AlarmStackInfoJsonStr'] = request.alarmStackInfoJsonStr;
  }
  if (!Util.isUnset(request.alarmStatusRepeatList)) {
    body['AlarmStatusRepeatList'] = request.alarmStatusRepeatList;
  }
  if (!Util.isUnset(request.alarmTargetKeyword)) {
    body['AlarmTargetKeyword'] = request.alarmTargetKeyword;
  }
  if (!Util.isUnset(request.alarmTargetType)) {
    body['AlarmTargetType'] = request.alarmTargetType;
  }
  if (!Util.isUnset(request.currentPage)) {
    body['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    body['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.workspaceName)) {
    body['WorkspaceName'] = request.workspaceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryRMSUnifiedAlarmEvent',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRMSUnifiedAlarmEvent(request: QueryRMSUnifiedAlarmEventRequest): QueryRMSUnifiedAlarmEventResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRMSUnifiedAlarmEventWithOptions(request, runtime);
}

model QueryRMSUnifiedAlarmHistoryRequest {
  alarmLevel?: long(name='AlarmLevel', example='1'),
  alarmStackInfoJsonStr?: string(name='AlarmStackInfoJsonStr', example='{\\"DatasourceType\\":\\"STACK\\",\\"AlarmTargetType\\":\\"APP\\",\\"AlarmTargetIdentify\\":\\"prod-app-twc-universal\\"}'),
  alarmTarget?: string(name='AlarmTarget', example='PlanetKms'),
  alarmTargetType?: string(name='AlarmTargetType', example='APP'),
  currentPage?: long(name='CurrentPage', example='2'),
  end?: long(name='End', example='1662516900000'),
  pageSize?: long(name='PageSize', example='10'),
  start?: long(name='Start', example='1668911820000'),
  status?: long(name='Status', example='1'),
  workspaceName?: string(name='WorkspaceName'),
}

model QueryRMSUnifiedAlarmHistoryResponseBody = {
  alarmHistories?: [ 
    {
      alarmContent?: string(name='AlarmContent'),
      alarmDetail?: string(name='AlarmDetail'),
      alarmLevel?: long(name='AlarmLevel', example='1'),
      alarmRuleId?: long(name='AlarmRuleId', example='860'),
      alarmRuleName?: string(name='AlarmRuleName'),
      alarmTarget?: string(name='AlarmTarget', example='sibei_1229_1'),
      alarmTargetDeleted?: boolean(name='AlarmTargetDeleted', example='false'),
      alarmTargetType?: string(name='AlarmTargetType', example='APP'),
      alarmTime?: long(name='AlarmTime', example='1671088115000'),
      alarmType?: string(name='AlarmType', example='APP'),
      alarmUrl?: string(name='AlarmUrl', example='/rms/sofacloud/sofa_app/view/a?workspaceName=b&tenantName=c'),
      alarmUrlWithDomain?: string(name='AlarmUrlWithDomain', example='http://www.alipay.com/rms/sofacloud/sofa_app/view/a?workspaceName=b&tenantName=c'),
      dataSourceName?: string(name='DataSourceName', example='ant_intel_hz'),
      eventId?: string(name='EventId', example='355402_1670998540000_598877597'),
      gmtCreate?: string(name='GmtCreate', example='2020-04-02 21:53:24'),
      gmtModified?: string(name='GmtModified', example='2020-04-02 21:53:24'),
      id?: long(name='Id', example='3376'),
      status?: long(name='Status', example='1'),
      tenantId?: long(name='TenantId', example='1'),
      uniqueIdentity?: string(name='UniqueIdentity', example='174851af-6c56-4d8b-8cc7-9f998e752f09'),
      workspaceId?: long(name='WorkspaceId', example='1'),
    }
  ](name='AlarmHistories'),
  currentPage?: long(name='CurrentPage', example='5'),
  pageSize?: long(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='CB2B427A-E370-5599-8872-A249F8EFD859'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='workspace not found with name TWCProd, tenant_id 0008528286'),
  totalCount?: long(name='TotalCount', example='120'),
}

model QueryRMSUnifiedAlarmHistoryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryRMSUnifiedAlarmHistoryResponseBody(name='body'),
}

async function queryRMSUnifiedAlarmHistoryWithOptions(request: QueryRMSUnifiedAlarmHistoryRequest, runtime: Util.RuntimeOptions): QueryRMSUnifiedAlarmHistoryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.alarmLevel)) {
    body['AlarmLevel'] = request.alarmLevel;
  }
  if (!Util.isUnset(request.alarmStackInfoJsonStr)) {
    body['AlarmStackInfoJsonStr'] = request.alarmStackInfoJsonStr;
  }
  if (!Util.isUnset(request.alarmTarget)) {
    body['AlarmTarget'] = request.alarmTarget;
  }
  if (!Util.isUnset(request.alarmTargetType)) {
    body['AlarmTargetType'] = request.alarmTargetType;
  }
  if (!Util.isUnset(request.currentPage)) {
    body['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.end)) {
    body['End'] = request.end;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.start)) {
    body['Start'] = request.start;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.workspaceName)) {
    body['WorkspaceName'] = request.workspaceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryRMSUnifiedAlarmHistory',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRMSUnifiedAlarmHistory(request: QueryRMSUnifiedAlarmHistoryRequest): QueryRMSUnifiedAlarmHistoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRMSUnifiedAlarmHistoryWithOptions(request, runtime);
}

model QueryRMSUnifiedAlarmNotifyHistoryRequest {
  alarmRuleId?: long(name='AlarmRuleId'),
  alarmStackInfoJsonStr?: string(name='AlarmStackInfoJsonStr'),
  alarmStatus?: long(name='AlarmStatus'),
  alarmSubscribers?: [ 
    {
      subscriber?: string(name='Subscriber'),
      subscriberName?: string(name='SubscriberName'),
      subscriberSource?: string(name='SubscriberSource'),
      subscriberType?: string(name='SubscriberType'),
      subscriberUuid?: string(name='SubscriberUuid'),
    }
  ](name='AlarmSubscribers'),
  channel?: string(name='Channel'),
  currentPage?: long(name='CurrentPage'),
  dashboardQueryParamJsonStr?: string(name='DashboardQueryParamJsonStr'),
  endTime?: long(name='EndTime'),
  eventId?: string(name='EventId'),
  keyword?: string(name='Keyword'),
  pageSize?: long(name='PageSize'),
  startTime?: long(name='StartTime'),
  status?: long(name='Status'),
  subscriber?: string(name='Subscriber'),
  workspaceName?: string(name='WorkspaceName'),
}

model QueryRMSUnifiedAlarmNotifyHistoryResponseBody = {
  alarmNotifyHistories?: [ 
    {
      aggCount?: long(name='AggCount'),
      alarmEventId?: string(name='AlarmEventId'),
      alarmHistoryId?: long(name='AlarmHistoryId'),
      alarmLevel?: long(name='AlarmLevel'),
      alarmRuleId?: long(name='AlarmRuleId'),
      alarmRuleName?: string(name='AlarmRuleName'),
      alarmRuleUuid?: string(name='AlarmRuleUuid'),
      alarmSilenceTime?: long(name='AlarmSilenceTime'),
      alarmStatus?: long(name='AlarmStatus'),
      alarmTargetDeleted?: boolean(name='AlarmTargetDeleted'),
      alarmTargetIdentify?: string(name='AlarmTargetIdentify'),
      alarmTargetType?: string(name='AlarmTargetType'),
      alarmTime?: long(name='AlarmTime'),
      alarmType?: string(name='AlarmType'),
      alarmUrl?: string(name='AlarmUrl'),
      alarmUrlWithDomain?: string(name='AlarmUrlWithDomain'),
      channel?: string(name='Channel'),
      dataSourceName?: string(name='DataSourceName'),
      errorMessage?: string(name='ErrorMessage'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      id?: long(name='Id'),
      notifyContent?: string(name='NotifyContent'),
      status?: long(name='Status'),
      subscriber?: string(name='Subscriber'),
      subscriberName?: string(name='SubscriberName'),
      subscriberSource?: string(name='SubscriberSource'),
      subscriberType?: string(name='SubscriberType'),
      tenantId?: long(name='TenantId'),
      traceId?: string(name='TraceId'),
      workspaceId?: long(name='WorkspaceId'),
    }
  ](name='AlarmNotifyHistories'),
  alarmNotifySubs?: [ 
    {
      subscriber?: string(name='Subscriber'),
      subscriberName?: string(name='SubscriberName'),
      subscriberSource?: string(name='SubscriberSource'),
      subscriberType?: string(name='SubscriberType'),
      subscriberUuid?: string(name='SubscriberUuid'),
    }
  ](name='AlarmNotifySubs'),
  currentPage?: long(name='CurrentPage'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  resultCode?: string(name='ResultCode'),
  resultMessage?: string(name='ResultMessage'),
  totalCount?: long(name='TotalCount'),
}

model QueryRMSUnifiedAlarmNotifyHistoryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryRMSUnifiedAlarmNotifyHistoryResponseBody(name='body'),
}

async function queryRMSUnifiedAlarmNotifyHistoryWithOptions(request: QueryRMSUnifiedAlarmNotifyHistoryRequest, runtime: Util.RuntimeOptions): QueryRMSUnifiedAlarmNotifyHistoryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.alarmRuleId)) {
    body['AlarmRuleId'] = request.alarmRuleId;
  }
  if (!Util.isUnset(request.alarmStackInfoJsonStr)) {
    body['AlarmStackInfoJsonStr'] = request.alarmStackInfoJsonStr;
  }
  if (!Util.isUnset(request.alarmStatus)) {
    body['AlarmStatus'] = request.alarmStatus;
  }
  if (!Util.isUnset(request.alarmSubscribers)) {
    body['AlarmSubscribers'] = request.alarmSubscribers;
  }
  if (!Util.isUnset(request.channel)) {
    body['Channel'] = request.channel;
  }
  if (!Util.isUnset(request.currentPage)) {
    body['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.dashboardQueryParamJsonStr)) {
    body['DashboardQueryParamJsonStr'] = request.dashboardQueryParamJsonStr;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.eventId)) {
    body['EventId'] = request.eventId;
  }
  if (!Util.isUnset(request.keyword)) {
    body['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.subscriber)) {
    body['Subscriber'] = request.subscriber;
  }
  if (!Util.isUnset(request.workspaceName)) {
    body['WorkspaceName'] = request.workspaceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryRMSUnifiedAlarmNotifyHistory',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRMSUnifiedAlarmNotifyHistory(request: QueryRMSUnifiedAlarmNotifyHistoryRequest): QueryRMSUnifiedAlarmNotifyHistoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRMSUnifiedAlarmNotifyHistoryWithOptions(request, runtime);
}

model QueryRMSUnifiedAlarmRuleRequest {
  alarmStatus?: long(name='AlarmStatus'),
  alarmTargetJsonStr?: string(name='AlarmTargetJsonStr'),
  category?: string(name='Category'),
  currentPage?: long(name='CurrentPage'),
  keyword?: string(name='Keyword'),
  level?: long(name='Level'),
  onlyMe?: boolean(name='OnlyMe'),
  pageSize?: long(name='PageSize'),
  refDatasourceType?: string(name='RefDatasourceType', description='datasource'),
  ruleId?: long(name='RuleId'),
  ruleStatus?: long(name='RuleStatus'),
  ruleUniqueIdentity?: string(name='RuleUniqueIdentity'),
  workspaceName?: string(name='WorkspaceName'),
}

model QueryRMSUnifiedAlarmRuleResponseBody = {
  alarmRules?: [ 
    {
      alarmEmpty?: long(name='AlarmEmpty'),
      alarmStatus?: long(name='AlarmStatus'),
      category?: string(name='Category'),
      channels?: string(name='Channels'),
      conditionsDes?: [ string ](name='ConditionsDes'),
      creator?: string(name='Creator'),
      deleted?: long(name='Deleted'),
      emergency?: string(name='Emergency'),
      emergencyUrl?: string(name='EmergencyUrl'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      id?: long(name='Id'),
      level?: long(name='Level'),
      modifier?: string(name='Modifier'),
      name?: string(name='Name'),
      notifyEmpty?: long(name='NotifyEmpty'),
      notifyFiring?: long(name='NotifyFiring'),
      notifyRecovered?: long(name='NotifyRecovered'),
      notifyTimeFilter?: string(name='NotifyTimeFilter'),
      notifyTplId?: long(name='NotifyTplId'),
      pendingHit?: long(name='PendingHit'),
      recoveredHit?: long(name='RecoveredHit'),
      ruleConfig?: string(name='RuleConfig'),
      silenceTime?: long(name='SilenceTime'),
      sourceId?: string(name='SourceId'),
      status?: long(name='Status'),
      step?: long(name='Step'),
      suspendedEndTime?: long(name='SuspendedEndTime'),
      suspendedReason?: string(name='SuspendedReason'),
      suspendedStartTime?: long(name='SuspendedStartTime'),
      tenantId?: long(name='TenantId'),
      timeZone?: string(name='TimeZone'),
      uniqueIdentity?: string(name='UniqueIdentity'),
      workspaceId?: long(name='WorkspaceId'),
    }
  ](name='AlarmRules'),
  currentPage?: long(name='CurrentPage'),
  pageSize?: long(name='PageSize'),
  requestId?: string(name='RequestId'),
  resultCode?: string(name='ResultCode'),
  resultMessage?: string(name='ResultMessage'),
  totalCount?: long(name='TotalCount'),
}

model QueryRMSUnifiedAlarmRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryRMSUnifiedAlarmRuleResponseBody(name='body'),
}

async function queryRMSUnifiedAlarmRuleWithOptions(request: QueryRMSUnifiedAlarmRuleRequest, runtime: Util.RuntimeOptions): QueryRMSUnifiedAlarmRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.alarmStatus)) {
    body['AlarmStatus'] = request.alarmStatus;
  }
  if (!Util.isUnset(request.alarmTargetJsonStr)) {
    body['AlarmTargetJsonStr'] = request.alarmTargetJsonStr;
  }
  if (!Util.isUnset(request.category)) {
    body['Category'] = request.category;
  }
  if (!Util.isUnset(request.currentPage)) {
    body['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.keyword)) {
    body['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.level)) {
    body['Level'] = request.level;
  }
  if (!Util.isUnset(request.onlyMe)) {
    body['OnlyMe'] = request.onlyMe;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.refDatasourceType)) {
    body['RefDatasourceType'] = request.refDatasourceType;
  }
  if (!Util.isUnset(request.ruleId)) {
    body['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleStatus)) {
    body['RuleStatus'] = request.ruleStatus;
  }
  if (!Util.isUnset(request.ruleUniqueIdentity)) {
    body['RuleUniqueIdentity'] = request.ruleUniqueIdentity;
  }
  if (!Util.isUnset(request.workspaceName)) {
    body['WorkspaceName'] = request.workspaceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryRMSUnifiedAlarmRule',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRMSUnifiedAlarmRule(request: QueryRMSUnifiedAlarmRuleRequest): QueryRMSUnifiedAlarmRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRMSUnifiedAlarmRuleWithOptions(request, runtime);
}

model ResendMqSofamqDLQMessageBatchRequest {
  cell?: string(name='Cell', example='RZ01A'),
  groupId?: string(name='GroupId', example='GID_test_group_id'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  msgIds?: string(name='MsgIds', example='1E0578FE110F18B4AAC235C0C******,1E0578FE110F18B4AAC235C0C******'),
}

model ResendMqSofamqDLQMessageBatchResponseBody = {
  data?: string(name='Data', example='1E0578FE110F18B4AAC235C0C******,1E0578FE110F18B4AAC235C0C******'),
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model ResendMqSofamqDLQMessageBatchResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResendMqSofamqDLQMessageBatchResponseBody(name='body'),
}

async function resendMqSofamqDLQMessageBatchWithOptions(request: ResendMqSofamqDLQMessageBatchRequest, runtime: Util.RuntimeOptions): ResendMqSofamqDLQMessageBatchResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.msgIds)) {
    body['MsgIds'] = request.msgIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ResendMqSofamqDLQMessageBatch',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resendMqSofamqDLQMessageBatch(request: ResendMqSofamqDLQMessageBatchRequest): ResendMqSofamqDLQMessageBatchResponse {
  var runtime = new Util.RuntimeOptions{};
  return resendMqSofamqDLQMessageBatchWithOptions(request, runtime);
}

model ResendMqSofamqDLQMessageByIdRequest {
  cell?: string(name='Cell', example='RZ01A'),
  groupId?: string(name='GroupId', example='GID_test_group_id'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  msgId?: string(name='MsgId', example='1E0578FE110F18B4AAC235C0C******'),
}

model ResendMqSofamqDLQMessageByIdResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model ResendMqSofamqDLQMessageByIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResendMqSofamqDLQMessageByIdResponseBody(name='body'),
}

async function resendMqSofamqDLQMessageByIdWithOptions(request: ResendMqSofamqDLQMessageByIdRequest, runtime: Util.RuntimeOptions): ResendMqSofamqDLQMessageByIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.msgId)) {
    body['MsgId'] = request.msgId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ResendMqSofamqDLQMessageById',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resendMqSofamqDLQMessageById(request: ResendMqSofamqDLQMessageByIdRequest): ResendMqSofamqDLQMessageByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return resendMqSofamqDLQMessageByIdWithOptions(request, runtime);
}

model ResetMqSofamqConsumerOffsetRequest {
  cell?: string(name='Cell', example='RZ01A'),
  groupId?: string(name='GroupId', example='GID_test_consumer_id'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  resetTimestamp?: long(name='ResetTimestamp', example='1568033253'),
  topic?: string(name='Topic', example='test-mq-topic'),
  type?: long(name='Type', example='1'),
}

model ResetMqSofamqConsumerOffsetResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model ResetMqSofamqConsumerOffsetResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResetMqSofamqConsumerOffsetResponseBody(name='body'),
}

async function resetMqSofamqConsumerOffsetWithOptions(request: ResetMqSofamqConsumerOffsetRequest, runtime: Util.RuntimeOptions): ResetMqSofamqConsumerOffsetResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cell)) {
    body['Cell'] = request.cell;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.resetTimestamp)) {
    body['ResetTimestamp'] = request.resetTimestamp;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ResetMqSofamqConsumerOffset',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resetMqSofamqConsumerOffset(request: ResetMqSofamqConsumerOffsetRequest): ResetMqSofamqConsumerOffsetResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetMqSofamqConsumerOffsetWithOptions(request, runtime);
}

model UpdateMqSofamqGroupRequest {
  groupId?: string(name='GroupId', example='test_group_id'),
  instanceId?: string(name='InstanceId', example='SOFAMQ_INSTANCE_000001'),
  readEnable?: boolean(name='ReadEnable', example='true'),
}

model UpdateMqSofamqGroupResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model UpdateMqSofamqGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateMqSofamqGroupResponseBody(name='body'),
}

async function updateMqSofamqGroupWithOptions(request: UpdateMqSofamqGroupRequest, runtime: Util.RuntimeOptions): UpdateMqSofamqGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.readEnable)) {
    body['ReadEnable'] = request.readEnable;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMqSofamqGroup',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateMqSofamqGroup(request: UpdateMqSofamqGroupRequest): UpdateMqSofamqGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateMqSofamqGroupWithOptions(request, runtime);
}

model UpdateMqSofamqGroupRemarkRequest {
  groupId?: string(name='GroupId', example='test_group_id'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  remark?: string(name='Remark', example='test'),
}

model UpdateMqSofamqGroupRemarkResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model UpdateMqSofamqGroupRemarkResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateMqSofamqGroupRemarkResponseBody(name='body'),
}

async function updateMqSofamqGroupRemarkWithOptions(request: UpdateMqSofamqGroupRemarkRequest, runtime: Util.RuntimeOptions): UpdateMqSofamqGroupRemarkResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.remark)) {
    body['Remark'] = request.remark;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMqSofamqGroupRemark',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateMqSofamqGroupRemark(request: UpdateMqSofamqGroupRemarkRequest): UpdateMqSofamqGroupRemarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateMqSofamqGroupRemarkWithOptions(request, runtime);
}

model UpdateMqSofamqTopicRequest {
  instanceId?: string(name='InstanceId', example='000001'),
  perm?: long(name='Perm', example='6'),
  topic?: string(name='Topic', example='test'),
}

model UpdateMqSofamqTopicResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model UpdateMqSofamqTopicResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateMqSofamqTopicResponseBody(name='body'),
}

async function updateMqSofamqTopicWithOptions(request: UpdateMqSofamqTopicRequest, runtime: Util.RuntimeOptions): UpdateMqSofamqTopicResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.perm)) {
    body['Perm'] = request.perm;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMqSofamqTopic',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateMqSofamqTopic(request: UpdateMqSofamqTopicRequest): UpdateMqSofamqTopicResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateMqSofamqTopicWithOptions(request, runtime);
}

model UpdateMqSofamqTopicRemarkRequest {
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  remark?: string(name='Remark', example='test'),
  topic?: string(name='Topic', example='test'),
}

model UpdateMqSofamqTopicRemarkResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model UpdateMqSofamqTopicRemarkResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateMqSofamqTopicRemarkResponseBody(name='body'),
}

async function updateMqSofamqTopicRemarkWithOptions(request: UpdateMqSofamqTopicRemarkRequest, runtime: Util.RuntimeOptions): UpdateMqSofamqTopicRemarkResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.remark)) {
    body['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMqSofamqTopicRemark',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateMqSofamqTopicRemark(request: UpdateMqSofamqTopicRemarkRequest): UpdateMqSofamqTopicRemarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateMqSofamqTopicRemarkWithOptions(request, runtime);
}

model UpdateMqSofamqWarnRequest {
  alertTime?: string(name='AlertTime', example='00:00-24:00'),
  contacts?: string(name='Contacts'),
  delayTime?: long(name='DelayTime', example='10'),
  frequency?: long(name='Frequency', example='10'),
  instanceId?: string(name='InstanceId', example='MQ_INST_111111111111_DOxxxxxx'),
  threshold?: long(name='Threshold'),
  warnId?: long(name='WarnId', example='10000001'),
}

model UpdateMqSofamqWarnResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model UpdateMqSofamqWarnResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateMqSofamqWarnResponseBody(name='body'),
}

async function updateMqSofamqWarnWithOptions(request: UpdateMqSofamqWarnRequest, runtime: Util.RuntimeOptions): UpdateMqSofamqWarnResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.alertTime)) {
    body['AlertTime'] = request.alertTime;
  }
  if (!Util.isUnset(request.contacts)) {
    body['Contacts'] = request.contacts;
  }
  if (!Util.isUnset(request.delayTime)) {
    body['DelayTime'] = request.delayTime;
  }
  if (!Util.isUnset(request.frequency)) {
    body['Frequency'] = request.frequency;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.threshold)) {
    body['Threshold'] = request.threshold;
  }
  if (!Util.isUnset(request.warnId)) {
    body['WarnId'] = request.warnId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMqSofamqWarn',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateMqSofamqWarn(request: UpdateMqSofamqWarnRequest): UpdateMqSofamqWarnResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateMqSofamqWarnWithOptions(request, runtime);
}

model UpdateMsConfigAttributesRequest {
  attributeName?: string(name='AttributeName', example='age'),
  desc?: string(name='Desc'),
  id?: long(name='Id', example='1'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
}

model UpdateMsConfigAttributesResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model UpdateMsConfigAttributesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateMsConfigAttributesResponseBody(name='body'),
}

async function updateMsConfigAttributesWithOptions(request: UpdateMsConfigAttributesRequest, runtime: Util.RuntimeOptions): UpdateMsConfigAttributesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.attributeName)) {
    body['AttributeName'] = request.attributeName;
  }
  if (!Util.isUnset(request.desc)) {
    body['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMsConfigAttributes',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateMsConfigAttributes(request: UpdateMsConfigAttributesRequest): UpdateMsConfigAttributesResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateMsConfigAttributesWithOptions(request, runtime);
}

model UpdateMsConfigResourcesRequest {
  appName?: string(name='AppName', example='foo'),
  attributes?: string(name='Attributes'),
  desc?: string(name='Desc'),
  id?: long(name='Id', example='1'),
  instanceId?: string(name='InstanceId', example='abcdEFGH1234'),
  region?: string(name='Region', example='Alipay'),
  resourceId?: string(name='ResourceId', example='com.test.resource'),
  updateAttribute?: boolean(name='UpdateAttribute', example='false'),
}

model UpdateMsConfigResourcesResponseBody = {
  requestId?: string(name='RequestId', example='861E6630-AEC0-4B2D-B214-6CB5E44B7F04'),
  resultCode?: string(name='ResultCode', example='OK'),
  resultMessage?: string(name='ResultMessage', example='OK'),
}

model UpdateMsConfigResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateMsConfigResourcesResponseBody(name='body'),
}

async function updateMsConfigResourcesWithOptions(request: UpdateMsConfigResourcesRequest, runtime: Util.RuntimeOptions): UpdateMsConfigResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.attributes)) {
    body['Attributes'] = request.attributes;
  }
  if (!Util.isUnset(request.desc)) {
    body['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.region)) {
    body['Region'] = request.region;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.updateAttribute)) {
    body['UpdateAttribute'] = request.updateAttribute;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMsConfigResources',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateMsConfigResources(request: UpdateMsConfigResourcesRequest): UpdateMsConfigResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateMsConfigResourcesWithOptions(request, runtime);
}

model UpdateRMSUnifiedAlarmRuleRequest {
  alarmNodata?: long(name='AlarmNodata'),
  category?: string(name='Category', example='CUSTOM'),
  channelsRepeatList?: [ string ](name='ChannelsRepeatList'),
  emergency?: string(name='Emergency'),
  emergencyUrl?: string(name='EmergencyUrl'),
  id?: long(name='Id', example='1'),
  level?: long(name='Level', example='2'),
  name?: string(name='Name', example='TAGS'),
  notifyFiring?: long(name='NotifyFiring'),
  notifyNodata?: long(name='NotifyNodata'),
  notifyRecovered?: long(name='NotifyRecovered'),
  notifyTarget?: [ 
    {
      subscriber?: string(name='Subscriber', example='1'),
      subscriberName?: string(name='SubscriberName'),
      subscriberSource?: string(name='SubscriberSource', example='LOCAL'),
      subscriberType?: string(name='SubscriberType', example='USER_GROUP'),
      subscriberUuid?: string(name='SubscriberUuid', example='400'),
    }
  ](name='NotifyTarget'),
  notifyTimeFilterJsonStr?: string(name='NotifyTimeFilterJsonStr'),
  pendingHit?: long(name='PendingHit'),
  recoveredHit?: long(name='RecoveredHit'),
  ruleConfig?: string(name='RuleConfig', example='{\\"trafficType\\":\\"i\\",\\"methodName\\":\\"*\\",\\"faultInjectRuleItems\\":[{\\"action\\":{\\"type\\":\\"REJECT\\"},\\"ruleType\\":\\"ABORT\\",\\"configs\\":{\\"faultPercent\\":100}}]}'),
  silenceTime?: long(name='SilenceTime', example='900'),
  status?: string(name='Status', example='Firing'),
  step?: long(name='Step', example='5'),
  suspendedEndTime?: long(name='SuspendedEndTime'),
  suspendedReason?: string(name='SuspendedReason'),
  suspendedStartTime?: long(name='SuspendedStartTime'),
  workspaceName?: string(name='WorkspaceName', example='prod'),
}

model UpdateRMSUnifiedAlarmRuleResponseBody = {
  requestId?: string(name='RequestId'),
  resultCode?: string(name='ResultCode'),
  resultMessage?: string(name='ResultMessage'),
}

model UpdateRMSUnifiedAlarmRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateRMSUnifiedAlarmRuleResponseBody(name='body'),
}

async function updateRMSUnifiedAlarmRuleWithOptions(request: UpdateRMSUnifiedAlarmRuleRequest, runtime: Util.RuntimeOptions): UpdateRMSUnifiedAlarmRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.alarmNodata)) {
    body['AlarmNodata'] = request.alarmNodata;
  }
  if (!Util.isUnset(request.category)) {
    body['Category'] = request.category;
  }
  if (!Util.isUnset(request.channelsRepeatList)) {
    body['ChannelsRepeatList'] = request.channelsRepeatList;
  }
  if (!Util.isUnset(request.emergency)) {
    body['Emergency'] = request.emergency;
  }
  if (!Util.isUnset(request.emergencyUrl)) {
    body['EmergencyUrl'] = request.emergencyUrl;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.level)) {
    body['Level'] = request.level;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.notifyFiring)) {
    body['NotifyFiring'] = request.notifyFiring;
  }
  if (!Util.isUnset(request.notifyNodata)) {
    body['NotifyNodata'] = request.notifyNodata;
  }
  if (!Util.isUnset(request.notifyRecovered)) {
    body['NotifyRecovered'] = request.notifyRecovered;
  }
  if (!Util.isUnset(request.notifyTarget)) {
    body['NotifyTarget'] = request.notifyTarget;
  }
  if (!Util.isUnset(request.notifyTimeFilterJsonStr)) {
    body['NotifyTimeFilterJsonStr'] = request.notifyTimeFilterJsonStr;
  }
  if (!Util.isUnset(request.pendingHit)) {
    body['PendingHit'] = request.pendingHit;
  }
  if (!Util.isUnset(request.recoveredHit)) {
    body['RecoveredHit'] = request.recoveredHit;
  }
  if (!Util.isUnset(request.ruleConfig)) {
    body['RuleConfig'] = request.ruleConfig;
  }
  if (!Util.isUnset(request.silenceTime)) {
    body['SilenceTime'] = request.silenceTime;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.step)) {
    body['Step'] = request.step;
  }
  if (!Util.isUnset(request.suspendedEndTime)) {
    body['SuspendedEndTime'] = request.suspendedEndTime;
  }
  if (!Util.isUnset(request.suspendedReason)) {
    body['SuspendedReason'] = request.suspendedReason;
  }
  if (!Util.isUnset(request.suspendedStartTime)) {
    body['SuspendedStartTime'] = request.suspendedStartTime;
  }
  if (!Util.isUnset(request.workspaceName)) {
    body['WorkspaceName'] = request.workspaceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRMSUnifiedAlarmRule',
    version = '2019-08-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateRMSUnifiedAlarmRule(request: UpdateRMSUnifiedAlarmRuleRequest): UpdateRMSUnifiedAlarmRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateRMSUnifiedAlarmRuleWithOptions(request, runtime);
}

